Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp sql question
Message
De
28/09/2000 12:04:50
 
 
À
26/09/2000 12:52:18
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:
00422104
Vues:
15
>>>>>>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.
>How do you decide which adress to use if there are multiple addresses?

I have a Address type field, I have gone back and have added the group by clause which seems to do the trick.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform