467,149 Members | 1,361 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,149 developers. It's quick & easy.

WHERE colum1 = (SELECT with multiple results)

Hi I have a problem with a WHERE clause, I have to compare a column value to a query that returns multiple results, I also tried to substitute the "=" for "IN" but didn't worked.
Any help would be apreciated: D
Oct 10 '08 #1
  • viewed: 1220
Share:
2 Replies
Delerna
Expert 1GB
You could try something like this
Expand|Select|Wrap|Line Numbers
  1. SELECT field list
  2. FROM YourTable
  3. join (   SELECT TheMultipleResultField 
  4.           FROM TheRecordSource
  5.           WHERE YourFilterRequirements
  6. ) a on column1=TheMultipleResultField
  7.  
here, the join will filter out the rows that don't have matching
records in the subquery.
Oct 11 '08 #2
ck9663
Expert 2GB
Be careful with IN, it does not work well with NULL values.

I got some notes about that here

-- CK
Oct 12 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by anmar@intrex.net | last post: by
3 posts views Thread by d.schulz81@gmx.net | last post: by
4 posts views Thread by rn5a@rediffmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.