--same function different database: find the first 5 rows
?
select top 5 * from some_table???????????????????????????????????????? -- sql server
select * from some_table rownum >=1 and rownum<=5?? -- oracle (begin at 1)
?
select * from some_table limit 0, 5??????????????????????????????????? -- mysql (begin at 0)
?
select * from some_table limit 5 offset 0??????????????????????????? -- postgreSQL (begin at 0)
--however, if you want to implement between 10 to 20 in SQL SERVER, you have to use following trick
select top 10 * from
(select top 20 * from some_table) t
order by t.primary_key desc
posted on 2006-12-13 14:34
Jcat 閱讀(185)
評論(0) 編輯 收藏 所屬分類:
Database