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 |
|
wags317
Starting Member
1 Post |
Posted - 2005-09-19 : 16:38:29
|
| Here is some sample Data from the table I am using.User_id Cabinet_id user_right_id106 106 4106 107 4106 110 4106 111 4106 112 4106 113 4106 114 4106 115 4277 162 10277 162 11277 164 4277 164 8277 164 10277 164 11277 165 4277 165 8277 165 10277 165 11Is their a way I can query this table and find out what user_id and cabinet_id doesn't have an 11 user_right_id? thanks |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-09-19 : 16:45:25
|
| SELECT outr.User_id, outr.Cabinet_idFROM tbl AS outrWHERE NOT EXISTS(SELECT * FROM tbl AS innrWHERE innr.user_right_id = 11AND outr.User_id = innr.User_idAND outr.Cabinet_id = innr.Cabinet_id ) |
 |
|
|
|
|
|