Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data extraction - SQL
Message
 
 
À
02/09/2001 06:37:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00551572
Message ID:
00551588
Vues:
19
This message has been marked as the solution to the initial question of the thread.
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform