The important thing in life is to have a great aim , and the determination

常用链接

统计

IT技术链接

保险相关

友情链接

基金知识

生活相关

最新评论

各种数据库取表前N条记录的写法

 

各种数据库取表前N条记录的写法:

1Oracle

Select * from table where rowNum<=n

2.Informix

Select first n* from table

3.DB2

Select * row_number() over(order by col1 desc) as rownum where rownum<=n

 DB2

Select column from table fetch first n rows only

4.SqlServer

Select top n* from table

5.sysbase

Select top n* from table

6.mysql

Select * from table limit n

posted on 2008-10-13 10:15 鸿雁 阅读(473) 评论(1)  编辑  收藏 所属分类: IT技术相关

评论

# re: 各种数据库取表前N条记录的写法 2008-12-14 10:20 伊珊

美神恶魔  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: