select max(fid) as fid from
(
select max(fid) as fid from A where id='34483' union select max(fid) as fid from B where id='34483'
)tmp

select max(fid) as fid from
(
select * from A
union all
select * from B
) tmp
where id='34483'

解决方案 »

  1.   

    select max(fid) as fid from 
    (
    select max(fid) as fid from A where id='34483' union select max(fid) as fid from B where id='34483'
    ) tmp
      

  2.   

    select max(fid) aa from (select max(fid) as fid from A where id='34483' union select max(fid) as fid from B where id='34483') bb
      

  3.   

    select max(fid) from (select max(fid) as fid from A where id='34483' union select max(fid) as fid from B where id='34483') cc 
      

  4.   

    select top 1 fid from(
    select max(fid) as fid from A where id='34483' union select max(fid) as fid from B where id='34483') as tmp order by fid desc