select * from (
select t1_code,t1_code flag from table1
union all
select '  '+t2_code,t2_code from table2) tem order by flag

解决方案 »

  1.   

    select * from(
    select t1_code,t1_code as sortid from table1
    union all
    select space(2)+t2_code,t2_code from table2) a order by sortid
      

  2.   

    select * from (
     select t1_code,t1_code flag from table1
     union all
     select '  '+t2_code,t2_code flag from table2) tem order by flag
      

  3.   

    select code from (
    select t1_code code,t1_code flag from table1
    union all
    select '  '+t2_code code,t2_code from table2) t order by flag
      

  4.   

    select t1_code from (
    select t1_code,t1_code aa from t1
    union all
    select space(2)+t2_code t1_code,t2_code from t2 ) tem order by aa