/ Published in: SQL
This is how to run 2 separate queries and display them in the same window in order to compare the results.
You need to add the union all in between the queries. Then add a comma and null to the second query.
You need to add the union all in between the queries. Then add a comma and null to the second query.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT * FROM table1 UNION ALL SELECT * FROM table2 // ---------------- IF one TABLE has more COLUMNS than the other, THEN IN the TABLE WITH the fewer COLUMNS, ADD ,NULL TO the END OF the SELECT statement TO ADD COLUMNS TO the results. ADD AS many ",null"s AS you need TO MATCH the NUMBER OF COLUMNS TO the other TABLE.