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工程总结

你可能感兴趣的:(SQL,MySQL,Yahoo)