I need some help. Let's say I have 3 tables (t1(id,ds), t2(id,ds) and t3(id,ds)) where the tables don't necessarily have the same id fields.
I need sql select statement of which resault would be:
id ds1 ds2 ds3
So I would like to have a list of id (+ds1,ds2,ds3 - all of them, if the id doesn't exsist in one of the table, there shold be "") where one of the following is true: ds(t1)<>ds(t2) or ds(t2)<>ds(t3) or ds(t1)<>ds(t3).
If the id would be the same in all three tables, i would do this:
select t1.id, t1.ds, t2.ds, t3.ds from t1, t2, t3 where t1.ds<>t2.ds or t1.ds<>t3.ds or t2.ds<>t3.ds
But i don't know what to do in my case, where tables don't necessarily have the same id fields.
I am pretty new in sql, so any help would be appreciated. Thank you.