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 |
|
jamesdwhite
Starting Member
9 Posts |
Posted - 2007-02-27 : 13:46:14
|
| i have a table table1, which contains fk userId which references table2 users. i want to select all the users from table users that aren't in table1 how can i do thisthanks james |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2007-02-27 : 14:06:36
|
| select userid from table2 except select userid from table1but what is the key of table2?, I just assumed something...____________________________________got to love the new except operator!rockmoose |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-03-01 : 02:28:44
|
quote: Originally posted by jamesdwhite i have a table table1, which contains fk userId which references table2 users. i want to select all the users from table users that aren't in table1 how can i do thisthanks james
try this ...Select col1, col2 from table2 where col1 not in (select col1 from table1)Mahesh |
 |
|
|
|
|
|