select * from (select top 1 * from 表A order by id desc) a,(select top 1 * from 表B order by id) b

解决方案 »

  1.   

    或者:
    select * from(select * from 表A where id=(select max(id) from 表A)) a,(select * from 表B where id=(select min(id) from 表B)) b
      

  2.   

    什么乱七八糟的,不对,我自己做出来了。
    正确的如下:select * from (
      (select top 1 * from a ) as p
    cross join
      (select top 1 * from b order by b.id desc) as k
    )