select top 5 id,tid,xm,xb,nl,bz from( select xxb.*,1 as order_by from hot join xxb on xxb.tid=hot.tid union select top 5 * ,1 as order_by from xxb where bz = 1 order by id )x order by order_by
上面的错了,改改select top 5 id,tid,xm,xb,nl,bz from( select xxb.*,1 as order_by from hot join xxb on xxb.tid=hot.tid union select top 5 * ,2 as order_by from xxb where bz = 1 order by id )x order by order_by
from(
select xxb.*,1 as order_by
from hot
join xxb on xxb.tid=hot.tid
union
select top 5 * ,1 as order_by from xxb where bz = 1 order by id
)x
order by order_by
from(
select xxb.*,1 as order_by
from hot
join xxb on xxb.tid=hot.tid
union
select top 5 * ,2 as order_by from xxb where bz = 1 order by id
)x
order by order_by