MySql 语句中 limit 用法

LIMIT
SELECT * FROM table LIMIT [offset,] rows | rows OFFSET offset
1. use database_name;
2. select * from tbl_name;
3. select * from tbl_name limit 3;
4. select * from tbl_name limit 3,7;
5. select * from tbl_name limit 3,-1;

参考博文1:http://www.cnblogs.com/end/archive/2011/04/09/2010525.html
参考博文2:http://www.cnblogs.com/end/archive/2011/04/09/2010525.html
参考博文3:http://www.cnblogs.com/end/articles/627701.html
参考博文:mysql – 疯子的紫梦’s 学习窝http://lovefang.is-programmer.com/categories/2211/posts

1. 说明:前10条记录
select top 10 * form table1 where 范围
2. 说明:列出数据库里所有的表名
select name from sysobjects where type=’U’
3. SQL SERVER中直接循环写入数据
declare @i int
set @i=1
while @i<30
begin
insert into test (userid) values(@i)
set @i=@i+1
end