Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with select sql
Message
De
17/07/2003 11:25:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00811082
Message ID:
00811095
Vues:
15
I understand the question thusly, that he is looking for records where the combination of the two fields is duplicate.

Anyway, the basic approach is still the same: start with a GROUP BY to get values of duplicate records.

>I do not think you can do what you want in 1 SQL. Does the following provide the results you are asking for:
>select codigo, count(*) from mytable
>where NumCliente = NumDoc
>group by codigo having count(*) > 1
>into cursor crsTemp
>
>select * from mytable where codigo in
>(select codigo from crsTemp)
>into cursor crsResults
>
>>Hi
>>
>>I have one table , that have this fields : Codigo , NumCliente , NumDoc
>>and more ...
>>
>>I need make one select that returns , all records that NumCliente and NumDoc have the same value , that other record in table
>>
>>Exemple
>>
>>
>>Codigo       NumCliente     NumDoc
>>1                    1                    1
>>2                    2                    2
>>3                    3                    3
>>4                    4                    4
>>5                    1                    1
>>
>>
>>
>>Select may return Codigo 1 and 5 , because in this records NumCliente and NumDoc have the same value .
>>
>>
>>Do you understand ?
>>
>>Thanks
>>
>>
>>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform