SQL分頁查詢

thunder:


1.MYSQL實現
mysql> select * from user;
+----+----------+----------+-----------------+
| ID | username | password | email           |
+----+----------+----------+-----------------+
|  1 | admin    | admin    | [email protected]    |
|  2 | thomas   | 159753   | [email protected] |
|  3 | thomas1  | 159753   | [email protected] |
|  4 | huhu     | 159753   | [email protected]     |
|  5 | fdg      | dfg      | fdg             |
|  6 | sdf      | sd       | [email protected]    |
|  7 | d        | d        | [email protected]          |
+----+----------+----------+-----------------+
7 rows in set (0.00 sec)

mysql> select * from user limit 3,2;
+----+----------+----------+-------------+
| ID | username | password | email       |
+----+----------+----------+-------------+
|  4 | huhu     | 159753   | [email protected] |
|  5 | fdg      | dfg      | fdg         |
+----+----------+----------+-------------+
2 rows in set (0.00 sec)

mysql>
===================================================
2.MSSQLServer實現
select top 5 function_id,function_name from d_function
where function_id not in (select top 5 function_id from d_function)

6 月統計
7 部門查詢
8 公司查詢
9 工程招標
10 工程總結

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章