/*取一表前N條記錄,各個數據庫的SQL寫法:
1. Oracle SELECT * FROM TABLE1 WHERE ROWNUM<=N
2. DB2 SELECT * ROW_NUMBER() OVER(ORDER BY COL1 DESC) AS ROWNUM WHERE ROWNUM<=N
DB2 SELECT COLUMN FROM TABLE FETCH FIRST N ROWS ONLY
3. SQL Server SELECT TOP N * FROM TABLE1
4. MySQL: select * from table_name limit N
/*獲取隨機記錄的前N條記錄
1、db2:SELECT * FROM MYTABLE ORDER BY rand() DESC FETCH FIRST N ROWS ONLY
2、sqlserver:SELECT top 10 * FROM userinf ORDER BY NEWID()
3、MySQL: select * from tablename order by rand() limit 10