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 |
|
amirs
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-11-24 : 06:15:12
|
| hi in two table how to select all records in first table and select record in second table which is not exists in first table |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2008-11-24 : 06:21:11
|
| select * from bol union allselect * from bol2 where not exists (select 1 from bol where bol.pk=bol2.pk) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-24 : 06:34:06
|
| [code]select *from(select pk,othercols..,1 as cat from bol union allselect pk,othercols..,2 from bol2 )tgroup by pkhaving count(distinct cat)=1[/code] |
 |
|
|
|
|
|