Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL SELECT help needed.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SQL SELECT help needed.
Divers
Thread ID:
00401104
Message ID:
00401104
Vues:
71
I SELECTing records in a table, but don't know how to get what I want. Here's what I am SELECTing:

Field1 Field2 Field3 Field4
100 A
100 A A A
200 A
200 A A A
300 A
300 A A A
300 A B B
400 A
500 A
500 A A A

I want to discard all records that are EMPTY(Field3) AND
EMPTY(Field4) AND also have a duplicate number in Field1 like where Field1 = 100 and Field1 = 200 and Field1 = 300 and Field1 = 500. The first record of all those sets of records would be discarded. I would only SELECT all the records after the first record of those sets.
But I don't want to discard any records where Field 1 does not have a duplicate number in Field1 like where Field1 = 400. I would want to select the one and only record for Field1 = 400.

So the result of my SELECT would be:

Field1 Field2 Field3 Field4
100 A A A
200 A A A
300 A A A
300 A B B
400 A
500 A A A

How can I do this with a SELECT? TIA
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform