Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Query: ANY(1st comma-delimited field) IN(2nd comma-delimited field)


Message #1 by "Michael Mason" <Michael@M...> on Mon, 24 Feb 2003 16:56:48
Is there a way to compare a comma-delimited field against a series of 
values in an "IN" statement without parsing and creating muliple "OR" 
statements?

Replace this:
SELECT ... FROM ...
  WHERE 0 IN (1,5,9) 
     OR 2 IN (1,5,9) 
     OR 9 IN (1,5,9)

With something like this:
SELECT ... FROM ...
  WHERE ANY(0,2,9) IN(1,5,9)

Thanks,
Michael Mason
Michael@M... 

  Return to Index