Reputation: 101
I have two tables with multiples row. Table 1 has a few rows which Table 2 no has. And the opposite.
I need a query which will make a follow table from Table 1 and 2 and sort by ID. Rows Opt3 and Opt4 can be ignored. As below:
How to do a query with SELECT right?
Upvotes: 0
Views: 22
Reputation: 147196
Something like this should work:
(SELECT Id, Question, Answer, Descr, Opt1, NULL AS Opt2
FROM Table_1)
UNION
(SELECT Id, Question, Answer, Descr, NULL, Opt2
FROM Table_2)
ORDER BY Id
Upvotes: 1