SQL - Set Operations
Identify the error in the following SQL statement:
SELECT id FROM table1 UNION SELECT id FROM table2 ORDER BY 2;SELECT id FROM table1 UNION SELECT id FROM table2 ORDER BY 2;ORDER BY 2 means order by second column, but query selects only one column.
UNION with ORDER BY is valid if ORDER BY references existing columns.
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions