Return to Snippet

Revision: 67509
at October 1, 2014 02:01 by heathbo


Updated Code
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.

Revision: 67508
at September 30, 2014 07:16 by heathbo


Initial Code
select * from table1

union all

select *, null from table2

Initial URL

                                

Initial Description
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.

Initial Title
SQL:  How To Display & Compare 2 Query Results In The Same Window

Initial Tags

                                

Initial Language
SQL