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