在MSSQL中大家都习惯用Select top 这样的语句,但是在MySQL中,却不支持这样的语句。在MySQL中可以使用limit start,leng 来代替Select top 这样的语句,例如:“select * from table1 order by intem1 desc limit 100"就是查询前100条数据了。而且limit 还可以设定记录的开始位置,例如:"select * from table1 order by intem1 desc limit 2,100"就是从记录集中第二条数据开始,提取100条数据。
MySQL limit语句类似于MS SQL Top语句
最新推荐文章于 2023-06-15 10:59:31 发布