MySQL 几乎模拟了 Oracle,SQL Server等商业数据库的大部分功能,函数。但很可惜,到目前的版本(5.1.33)为止,仍没有实现ROWNUM这个功能。
下面介绍几种具体的实现方法.
建立实验环境如下mysql> create table tbl ( -> id int primary key, -> col int -> );Query OK, 0 rows affected (0.08 sec)
mysql> insert into tbl values -> (1,26), -> (2,46), -> (3,35), -> (4,68), -> (5,93), -> (6,92);Query OK, 6 rows affected (0.05 sec)Records: 6 Dup......
阅读全文