标签:原创 ons blog tail ble number http HERE das
TOP 子句用于规定要返回的记录的数目。
1、SQL server的语法:
SELECT TOP number|percent column_name(s) FROM table_name;
例子:从表persons中选取前2行的数据;
SELECT TOP 2 * FROM persons;
从表persons中去前50%的 数据:
SELECT TOP 50 percent * from persons;
2、MySQL的语法:
SELECT column(s) FROM table_name LIMIT number;
例子:查看前5行数据:
3、Oracle的语法:
SELECT * FROM table_name where ROWNUM<=number;
例子:查看前5行的数据:
SELECT * FROM persons where ROWNUM <=5;
————————————————
版权声明:本文为CSDN博主「蓝星部队」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lanxingbudui/java/article/details/80903143
标签:原创 ons blog tail ble number http HERE das
原文地址:https://www.cnblogs.com/jasy/p/12858320.html