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 |
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2008-11-17 : 16:18:56
|
| i am trying to write a query that will allow me to get email addresses from an temp table that arent in my main tablesql below will give me the ones that are in the table is i use "in" but will not get me the email that are not in the table when I use "not in"what am i doing wrong -- both are varchar(100)SELECT emailFROM temp_emailwhere email not IN (SELECT emailFROM tblUser) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-11-17 : 16:26:01
|
NOT IN is not the opposite of IN, regarding NULL values. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
tpiazza55
Posting Yak Master
162 Posts |
Posted - 2008-11-17 : 16:31:03
|
| kicked the nulls out and it worked thanks |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-11-18 : 04:49:38
|
| SELECT t1.emailidFROM temp_email t1inner jointblUser AS t ON t.emailid NOT LIKE t1.emailid Group by t1.emailid having count(t1.emailid) > 1 |
 |
|
|
|
|
|