I have two tables:
table1
#id_table1 | code1
#---------------------
# 1 | abc
# 2 | abcd
# 3 | abcde
table2
#id_table2|code2
#--------------------
# 1 | aaa
# 2 | bbb
# 3 | abcde
If i want to join this two tables and get records which are in both tables:
SELECT table1.code1, table2.code2 FROM table1, table2
WHERE table1.code1=table2.code2
Result: abcde
It's easy, but now I need to do the opposite : I want records from table1.code1 which aren't in table2.code2
Result i need: abc, abcd
And records from table2.code2, which aren't in table1.code1
Result i need: aaa, bbb
I would appriciate any help - thanks in advance!