查询前几条记录 top limit

SQL Server 数据库中的Top关键字可实现查询数据库表中的前几条数据,但是需要注意的是,Top关键字只能在SQL Server数据库中可以使用,而在MySQL数据库中就要使用具有同样功能的LIMIT函数。

mysql筛选符合条件的前3条数据[limit]

select * from product_info where product_prevention = '玉米' limit 3;
1
sql server筛选符合条件的前3条数据[top]

select top 3 * from why;

猜你喜欢

转载自www.cnblogs.com/znsongshu/p/10213350.html