日期:2014-05-17  浏览次数:20746 次

将2张表的查询结果进行分页
SQL code
select top 2 * from (select * from actor,movie where actor.aid=movie.mid) c where c.id not in(select top 2 id from c) 
报对象名c无效,请问正确的sql语句该怎么写呢

------解决方案--------------------
Java code

select top 2 * from (select * from actor,movie where actor.aid=movie.mid )T1 
where id not in
     (select top 2 id 
      from 
      (select * from actor,movie where actor.aid=movie.mid )T2
      )