- 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)
------解决方案--------------------------------------------------------
- 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 )