当前位置: 代码迷 >> Java Web开发 >> 将二张表的查询结果进行分页
  详细解决方案

将二张表的查询结果进行分页

热度:1739   发布时间:2013-02-25 21:14:17.0
将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      )
  相关解决方案