SELECT CodeNo ;
FROM mytable ;
WHERE CertNo IN ( 10, 15) ;
GROUP BY 1 ;
INTO CURSOR ;
mycursor
or
SELECT DISTINCT CodeNo ;
FROM mytable ;
WHERE CertNo IN ( 10, 15) ;
INTO CURSOR ;
mycursor
>Hi all,
>
>I have a table having multiple records for a given master file record. I need to extract only those records (from the multiple records table) that meet one/more than one condition(s) (joined by AND clause only) based on a value in a particular column of this table. How can I achieve my goal ?
>
>I give below a sample table for easy understanding –
>
>CodeNo CertNo
>
>1 10
>1 15
>1 20
>2 10
>2 15
>2 25
>3 10
>3 25
>
>From the above, I need to extract all those records (CodeNo) which have CertNo = 10 AND CertNo = 15
>
>This should result in CodeNo 1 and CodeNo 2 only being extracted
>
>How can I get the desired result using VFP/SQL
>
>Thanks in advance.
--sb--