If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > sql version of "is not among"?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-04, 09:52
psychomachine psychomachine is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
sql version of "is not among"?

What would be the correct sql syntax for a query along these lines:

select * from table1 where table1.id IS NOT AMONG table2.particularcolumn


sorry, i really got stuck.
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 11:23
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
select * FROM table1 LEFT JOIN table2 USING (particularcolumn)
WHERE table1.particularcolumn IS NULL;
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 11:24
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
my bad. should read,

select * FROM table1 LEFT JOIN table2 USING (particularcolumn)
WHERE table2.particularcolumn IS NULL;
Reply With Quote
  #4 (permalink)  
Old 03-01-04, 12:04
psychomachine psychomachine is offline
Registered User
 
Join Date: Feb 2004
Posts: 6
great!!! many thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On