database - Check two tables and find values not in both using SQL -
i have 2 tables returning reference code from. need compare both these lists find references exists in tablea or tableb, not in both.
as example, if table , table b had following data
table references 01 02 04 table b references 01 22
i expect return table following
table c references 02 04 22
the sql has me stumped. suggestions?
try this,
select col1 ( select col1 table_a union select col1 table_b ) x group col1 having count(*) =1
this query eliminate if value comes twice in same table.
Comments
Post a Comment