Hi,

For quite a simple table-structure, ie. Person, Criteria, and PersonCriteria 
(the combi-table), I have set up a query at the moment that selects alle 
persons that possess all selected criteria. The query itself looks like this at 
the moment:

Select p.PersonID
        From Person p,
                (
                Select Distinct PersonID, CriteriaID
                From PersonCriteria
                Where CriteriaID in (#arguments.criteriaIDs#)
                ) k
                Where p.PersonID= k.PersonID
                Group BY p.PersonID
                Having Count(*) = #Listlen(arguments.criteriaIDs)#

sofar no problem and everything works fine.

Now I want to offer the possibility for the user to add some AND and OR 
variables in their search, ie. someone could say: I'm looking for a person that 
possesses: Criteria 1 AND 3 AND 4 (which would be covered by the query above) 
AND (5 OR 6) AND (8 OR 9) etc....

I'm not sure where to start with this additional level. I hope someone else 
does..:-)

thanks!
Bart


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3232
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to