Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with select sql
Message
 
 
À
17/07/2003 10:54:44
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:
00811094
Vues:
15
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
>
>
>
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform