mysql sql语句中的limit用法
1、select * from tablename <条件语句> limit 100,15
从100条记录后开始(不包括第100条记录)取出15条记录 (实际取出的是第 101-115条记录数据)
2、select * from tablename <条件语句> limit 15
取出 前15条记录数据,limit 15相当于 limit 0,15
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
drop table #Tmp --删除临时表#Tmp
create table #Tmp --创建临时表#Tmp
(
ID int IDENTITY (1,1) not null, --创建列ID,并且每次新增一条记录就会加1
WokNo &n ......
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://copyzhu.blogbus.com/logs/10168078.html
来源:小张.NET
建立表:
CREATE TABLE [TestTable] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[FirstName ......
--用户与角色关系
select a.uid as uid,a.status as uStatus,a.name as uName,
b.uid as rId,b.status as rStatus,b.name as rName
from sysusers a inner join sysusers b on a.gid = b.uid
where a.issqlrole = 0 and a.isapprole = 0 and a.hasdbaccess = 1 and (b.issqlrole = 1 or b.isapprole = 1)
......