select e.expid,e.explain,e.subdate,e.account,e.state,e.perId,e.exaPerId,
p1.pername as pername, p2.pername as exapername,d.content as statestr
from expense as e
inner join person as p1 on (e.perid = p1.perid)
inner join person as p2 on (e.exaperid = p2.perid)
inner join diction as d on (e.state=d.keyword)
where explain like '%交通%'
SQL入门者求助:
我想对这条SQL语句进行分页 请问该怎么写?
谢谢!! ------最佳解决方案--------------------
大概
;with c as (
select rn=row_number() over(order by x.xx),* from tb x
)
select * from c where rn between @a and @b;
可以
select top xx * from (select top yy * from tb order by id asc) a order by id desc