Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with select sql
Message
 
 
To
17/07/2003 10:54:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00811082
Message ID:
00811094
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform