select top 20 * from (select * from a union all select * from b union all select * from c union all select * from d union all select * from e)
select top 20 'a' as tablename ,* from a where aid=1 union all select top 20 'b',* from b union all select top 20 'c',* from c where cmov=1 union all select top 20 'd',* from d union all select top 20 'e',* from e order by atm desc 自己把字段改下,保持个数一致
select top 20 * from
(select * from a
union all
select * from b
union all
select * from c
union all
select * from d
union all
select * from e)
union all
select top 20 'b',* from b
union all
select top 20 'c',* from c where cmov=1
union all
select top 20 'd',* from d
union all
select top 20 'e',* from e
order by atm desc 自己把字段改下,保持个数一致