Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp sql question
Message
De
26/09/2000 12:22:57
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00420493
Message ID:
00421018
Vues:
21
>>>>I am trying to select distinct records from a sql statement in vfp.
>>>>But the distinct keyword only works on the whole record.
>>>>My question is there a way to limit records by a distinct column in vfp6.0? Thanks Eric
>>>
>>>The DISTINCT predicate does work on columns. Can you post the SQL statement that is giving you trouble?
>>
>>I have a persons table and a address table. The address table can have multiple
>>records for a particular person. The code goes as follows:
>>
>>SELECT DISTINCT PERSONS.ID, ADDRESS.STREET, ADDRESS.CITY, ADDRESS.STATE,; ADDRESS.ZIP FROM PERSONS, ADDRESS ;
>>WHERE PERSONS.ID = ADDRESS.ID ;
>>INTO TABLE Q1
>
>Sorry, but I was incorrect about the DISTINCT predicate, as you probably already know :). Are you trying to get just one address for each person? Or are you trying to get all people with more than one address?

I am trying just to grab a person with a address, but I get several records for a person with several address records. I generally have to create a index on the id unique and that works fine.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform