Friday, February 24, 2012

How to build my SQL querry.

Hi.
I know this querry:

"SELECT TOP 10 * FROM MyTable ORDERBY ..."

will give the top 10 rows.

But how can I build a querry that can get the rows from 40-50 (ie).
Thanks.Try below code, it could helps you!

select top 10 * from (Select distinct top 50 * From TBLNAME order by Fieldname desc) a order by Fieldname asc|||This is a good example

http://www.4guysfromrolla.com/webtech/062899-1.shtml

No comments:

Post a Comment