I need to say, optionId = 1 AND (4 or 6 or 6) .... etc...

that's what the HAVING clause does     ;o)

I don't understand whats happening at teh bottom of the query..
can you dumb it down for me?

use the ON clause of the join to select only those rows you're interested in --

  and assetPropertyOption.optionId
       in ( 2, 8, 12 )

and then, after applying the GROUP BY clause to group the option rows for each asset, use the HAVING clause to count the option rows for each asset according to your specific requirements

having sum(case when assetPropertyOption.optionId = 2
               then 1 else 0 end ) = 1

there must be exactly one option 2

  and sum(case when assetPropertyOption.optionId in ( 8, 12 )
               then 1 else 0 end ) > 0

there must be at least one option which is either 8 or 12
Whee do you live? anywhere beerable?

centre of the universe -- toronto canada

;o)


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
      Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to