1、sqlite3数据库
select * from QG order by random() limit 6
以下显示前10条记录
2、SQL Server数据库
select top 10 * from table_name;
3、DB2数据库
select * from table_name fetch first 10 rows only;
4、Oracle数据库
select * from table_name where rownum <=10;
5、MySQL数据库
select * from table_name limit 10;
6、Informix 数据库
select first 10 * from table_name;
7、Teradata数据仓库
select * from table_name sample 10;
原文:https://www.cnblogs.com/xkdn/p/12355979.html