SQL——MySQL、Oracle、SQL server数据库查询表中前N条记录

在MySQL、Oracle、SQL server数据库中,查询表中前N条记录的关键字不同。

MySQL使用limit

Oracle使用rownum

SqlServer使用top

例如:查询出city表中前5行的记录数据

--MySQL
select * from city limit 5
--SqlServer
select top 5 * from city
--Oracle
select * from city rownum <= 5
原文地址:https://www.cnblogs.com/it-mh/p/13958854.html