I have a simple table containing personID-choiceID pairs. I want to retrieve PersonIDs that have opted for one choice and another and another etc... Using an intersect query may not be the best way but ...
(SELECT * from <table> WHERE choiceID= [variable])
intersect
(SELECT * from <table> WHERE choiceID= [another variable]);
doesn't seem to work. (A straight UNION does).
What am I doing wrong?
Would using WHERE EXISTS make more sense?
Will this work in with mySQL as well?
(SELECT * from <table> WHERE choiceID= [variable])
intersect
(SELECT * from <table> WHERE choiceID= [another variable]);
doesn't seem to work. (A straight UNION does).
What am I doing wrong?
Would using WHERE EXISTS make more sense?
Will this work in with mySQL as well?