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 |
|
johnf
Starting Member
1 Post |
Posted - 2009-07-20 : 12:48:59
|
| Can anyone tell me why these 2 quesries produce different results ?select z.licenceID from dbo.t_Import_Fields_Fields zwhere z.licenceID not in (select x.licenceID from dbo.t_Import_Fields_Fields xwhere x.fieldstatus = 'organic') - RETURNS 0 RECORDSselect z.licenceID from dbo.t_Import_Fields_Fields zleft outer join (select licenceID from dbo.t_Import_Fields_Fields where fieldstatus = 'organic')xon z.licenceid = x.licenceidwhere x.licenceid is null - RETURNS 498 RECORDSif it helpsthe table dbo.t_Import_Fields_Fields has some 130,000 records of which approx 82,000 have a status of organic - there are 4,606 distinct LICENCEID'sthanksJohn |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-07-20 : 12:57:55
|
| Here is why by Mladen:http://weblogs.sqlteam.com/mladenp/archive/2007/05/18/60210.aspx |
 |
|
|
|
|
|