|
select * from
(select *,(@i:= @i+1) AS r from nl_group g,(select @i:=0) b order by end_time desc) a
where r>(select r from
(select *,(@i:= @i+1) AS r from nl_group g,(select @i:=0) b order by end_time desc) a
where gid=1)
以上的sql已经达到我想要的,但是感觉写的好复杂,那个a不能在里面复用么
|
|