Two database tables – Primary and Secondary – have same structure, where W, H and D are primary key fields.
Task: Find records meeting the condition W=100, H=500, and D=300 from both tables, and output the eligible record in Primary table first and then each related record in Secondary table. Below is the expected result:
A1, A2: Run simple SQL statements to perform conditional queries.
A3: Return null if A2 is empty; and if A2 isn’t empty, loop through each record of A1 (represented by ~), concatenate ~ and A2, and then concatenate results of all rounds of loops.
Top comments (0)