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 |
lokhande.shirish
Starting Member
4 Posts |
Posted - 2007-02-12 : 06:11:03
|
Hi,I have following issue : I am having two table, Table A and Table B.Both having ID columnTable A is master table and Table B is child table.Both table having relationship.Table A having four records:abcdTable B having two records : abNow I want a query which will give me records which are not in table B i.e c and d.I dont want IS not in format.Can any one help me.Regardsshirish |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-02-12 : 06:15:30
|
select *from tblawhere id not in (select id from tblb)select a.*from tbla aleft join tblb bon a.id = b.idwhere b.id is null==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-12 : 06:33:43
|
select tablea.*from tablea left join tableb on tableb.col1 = tablea.col1where tableb.col1 is nullPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|