sql在不同数据库查询前几条数据
sql在不同数据库查询前几条数据
1.ORACLE
SELECT*FROMTABLE1WHEREROWNUM<=N
HQL:fromtable1torderbyt.createTimedescwhererownum<=n
2.INFORMIX
SELECTFIRSTN*FROMTABLE1
3.DB2
SELECT*ROW_NUMBER()OVER(ORDERBYCOL1DESC)ASROWNUMWHEREROWNUM<=N
或者
SELECTCOLUMNFROMTABLEFETCHFIRSTNROWSONLY
4.SQLSERVER
SELECTTOPN*FROMTABLE1
5.SYBASE
SETROWCOUNTN
GO
SELECT*FROMTABLE1
6.MYSQL
SELECT*FROMTABLE1LIMITN
hibernate查询记录的前10条记录
就像mysql的SQL语句的"select*fromtablelimit10"hql不支持limit
query.setFirstResult(0);//从第0条开始取
query.setMaxResults(10);//取十条记录
7.FOXPRO
SELECT*TOPNFROMTABLEORDERBYCOLUMN
8.postgres查询前几条记录SQL
SELECT*FROMTABLELIMIT
相关推荐
whyname 2020-08-16
明月清风精进不止 2020-07-05
URML 2020-07-04
CSDN0BLOG 2020-06-21
goodriver 2020-06-17
专注前端开发 2020-10-21
苏康申 2020-11-13
vitasfly 2020-11-12
oraclemch 2020-11-06
liuyang000 2020-09-25
FellowYourHeart 2020-10-05
赵继业 2020-08-17
Seandba 2020-08-16
dbasunny 2020-08-16
拼命工作好好玩 2020-08-15
langyue 2020-08-15
写程序的赵童鞋 2020-08-03