Re: sql select top clause

Author: Gérard Lochon

Posted: 2011-02-21 at 14:49:32

>

> But I do not want to have a VFP index in this cursor or have to create

> another cursor from the obtained recordset. I just want to get the

> cursor directly from SQL Server, ordered from 13 to 22.

>

> Any suggestions?

You may use a nested subquery :

SELECT * FROM (;

select top 20 itemcode,(some more records) ;

from silver.dbo.items ;

where itemcode< 23 ;

order by itemcode desc ;

) AS xx ;

ORDER BY itemcode

Hope this helps.

Gérard.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/84D9FCB67732409CA4DC94B5BCA0E9DB@MuriellePC

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2011 Gérard Lochon