1. 程式人生 > >資料庫查詢前幾條資料

資料庫查詢前幾條資料

1. ORACLE

  SELECT * FROM TABLE1 WHERE ROWNUM<=N

  HQL: from table1 t order by t.createTime desc where rownum<=n

2. SQL SERVER

SELECT TOP N * FROM TABLE1

3. MYSQL

SELECT * FROM TABLE1 LIMIT N