I want to select distinct values of Column A where Column B = any members of a set S.
Is there a way to do this directly in SQL without looping and then filtering afterwards in code?
Thanks
EDIT: The set S is a PHP array. Does this make a difference?
Use the
INclause with a list of values, or a subquery (not sure if supported in MySql since I use Oracle). The match can be on more than one column.