* #1-1 , 2 conditions. Hard to expand for more than 3 conditions SELECT CodeNo ; FROM mytable ; WHERE CertNo = 10 AND CodeNo IN ( ; SELECT CodeNo ; FROM mytable ; WHERE CertNo = 15) ; GROUP BY 1 ; INTO CURSOR mycursor * #2-1, for 2 conditions. Works only if CodeNo+Certno combination is unique * Can easily be expanded to any number of conditions. See next example SELECT CodeNo ; FROM mytable ; WHERE CertNo IN ( 10, 15) ; GROUP BY 1 ; HAVING COUNT(*) > 1 ; INTO CURSOR mycursor * #2-2, for 3 conditions. See comments to the previous example SELECT CodeNo ; FROM mytable ; WHERE CertNo IN ( 10, 15, 20) ; GROUP BY 1 ; HAVING COUNT(*) > 2 ; INTO CURSOR mycursor * #3-1, another one for 2 condition * Can be expanded only up to 7 conditions * because of the limit of 6 JOIN's per select SELECT t1.CodeNo ; FROM mytable as t1 ; JOIN mytable as t2 ON t1.codeno = t2.codeno ; AND t2.certno = 15 ; WHERE t1.certno = 10 ; INTO CURSOR mycursor * #3-3, for 3 condition SELECT t1.CodeNo ; FROM mytable as t1 ; JOIN mytable as t2 ON t1.codeno = t2.codeno ; AND t2.certno = 15 ; JOIN mytable as t3 ON t1.codeno = t3.codeno ; AND t3.certno = 20 ; WHERE t1.certno = 10 ; INTO CURSOR mycursor>Dear Sergey