Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
scottichrosaviakosmos
Yak Posting Veteran
66 Posts |
Posted - 2011-05-26 : 08:57:45
|
| i have 2 table let say table A and table B.A have values 1,2,3B has values 1,2,4i want query using joins which give all values like:1234normally joins fetch matching or non matching data .. but how to get over this.And this has to be achieved only by joins.scoo |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-26 : 09:02:11
|
[code]select col from A union select col from B[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
scottichrosaviakosmos
Yak Posting Veteran
66 Posts |
Posted - 2011-05-26 : 10:14:42
|
| Thank you , but i think i have written that this should be done by joins only. SO only joins.scoo |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-26 : 10:28:58
|
then use FULL OUTER JOINselect col = coalesce(a.col, b.col)from tablea a full outer join tableb b on a.col = b.col KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|