|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help w/ SQL Statement - Finding what's NOT on a table
I have 3 tables setup: admin, site, adminsite.
I use the unique id fom admin and site to populate the adminsite table. I am looking for a SQL statement that will allow me to pull all of admins that are NOT listed on the adminsite table. Can anyone lend a hand with this? Thanks Marcus |
|
#2
|
|||
|
|||
|
Figured it out:
SELECT * FROM ADMIN WHERE not exists (select * from SITEADMIN Where ADMIN.A_ID = SITEADMIN.admin_id); |
|
#3
|
||||
|
||||
|
It would help to know how the tables are related, but you can try this
Code:
SELECT * FROM Admin WHERE AdminID NOT IN ( SELECT DISTINCT AdminID FROM AdminSite ) |
|
#4
|
|||
|
|||
|
Mem:
Thanks for the input, i always appreciate your help. -Marcus |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Help w/ SQL Statement - Finding what's NOT on a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|