我的sql语句是:从三张表中进行联合查询
select t.ID as ID,t.nvcTitle as nvcTitle,t.nvcOrigin as nvcOrigin,t.nvcChargeManGH as nvcChargeManGH,t.nvcThisConnMan as nvcThisConnMan,t.intCustmorID as intCustmorID,t.nvcContent as nvcContent,t.dtmTime as dtmTime,t.nvcState as nvcState,t.nvcDemo as nvcDemo,t.nvcTelNo as nvcTelNo,c.nvcTel as nvcTel,c.nvcEmail as nvcEmail,c.QQ as QQ,c.nvcLXR as nvcLXR,c.nvcCustomerName as nvcCustomerName,e.nvcName as nvcChargeManName from sell_Tel t,baseInfo_Coustomer c,baseInfo_Employee e where t.intCustmorID=c.intCustomerID and t.nvcChargeManGH=e.nvcZGH order by ID DESC offset 0 rows fetch next 18 rows only
那应该怎么写?能贴上您的代码吗?
追答简单给你个例子
select top N*P ID from table where ID not in (Select top (N-1)*P ID from table order by ID)
order by ID
ID:分页标准字段,按照此字段来进行分页
N:页数
P:每页显示数目
自己改吧
OK
本回答被提问者采纳是2012版本的啊
追答OFFSET - FETCH NEXT 语句没问题
offset 0 rows fetch next 18 rows only 注释掉运行下试试
嗯,注释后确实没问题,但是现在需要的是分页啊,后面的fetch语句原以为可以实现分页的目的……