Hi Fabio,
In your case you can use GROUP BY to eliminate duplicates
SELECT TOP 1 * ;
FROM ctop ;
GROUP BY 1 ;
ORDER BY 1
>Hi
>
>CREATE CURSOR ctop (dato I)
>INSERT INTO ctop values(1)
>INSERT INTO ctop values(1)
>INSERT INTO ctop values(1)
>
>SELECT TOP 1 * from ctop ORDER BY 1
>
>You have 3 row.
>
>Help document ( badly ) this behaviour.
>
>Exact behaviour is:
>With TOP N (< =32,767) clause, query return N rows plus all the residual rows of the last equal group defined by ORDER clause.
>
>Question:
>
>Can replay MSQL TOP N behaviour, for N< =32,767, with one single SELECT command ?
>If not exists, which it is the best VFP sequence commandos for do it ?
>
>Fabio
--sb--