Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rid Duplicates with SQL
Message
De
03/11/2014 15:25:18
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01610363
Message ID:
01610420
Vues:
38
Got it loud and clear! Thanks.

>In order to get elegant solution you have to have proper data. I can offer only ugly one for your data
>
>SELECT Field1, Field2, MIN(Field3), ... MIN(Field9) 
>FROM FOO GROUP BY Field1, Field2
>
>
>
>>
>>I want all the fields in the result. Your options only give me field1 and field2.
>>
>>I coull SET the ENGINEBEHAVIOUR to 80. This will allow it. However, I am looking for an elegant solution in 9.0.
>>
>>Yossi
>>
>>>Hi Yossi,
>>>
>>>SELECT DISTINCT Field1, Field2 FROM FOO
>>>SELECT Field1, Field2 FROM FOO GROUP BY Field1, Field2
>>>
>>>
>>>MartinaJ
>>>
>>>>Hi All:
>>>>
>>>>Consider the following table, FOO.
>>>>
>>>>
>>>>Field1   Field2   Field3   Field4   Field5   Field6   Field7   Field8   Field9
>>>>cat        dog       ...          ...          ...         ...          ...          ...          ...
>>>>cat        mouse
>>>>fish       goat
>>>>cat        dog
>>>>
>>>>
>>>>If I say SELECT FOO.*, I will get 4 records. However, I do not want duplicates of field1+field2. I do not care which record I get.
>>>>
>>>>SELE DISTINCT will not work, since there may be differences in the other fields.
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform