select dwdm,sl from a where dwdm>=30200197 and <=30200202 
union 
select 6666666 as dwdm,s1 from a where dwdm < 30200197 or dwdm > 30200202

解决方案 »

  1.   

    select dwdm,sl from a where dwdm>=30200197 and dwdm<=30200202
    union
    select '66666666' dwdm,sl from a where dwdm<30200197 and dwdm>30200202
      

  2.   

    sorry,nunchakus(双节棍) 是正解
    select dwdm,sl from a where dwdm>=30200197 and dwdm<=30200202
    union
    select '66666666' dwdm,sl from a where dwdm<30200197 or dwdm>30200202
      

  3.   

    select * from 
    (select dwdm,sl from tbname where dwdm>=30200197 and <=30200202 
    order by dwdm desc) t
    union all
    select dwdm,sl from tbname where dwdm<30200197 or >30200202 ; 
      

  4.   

    union 不行!
    union 会自动对其进行升序排序。
      

  5.   

    即把dwdm>=30200197 and <=30200202的按降序排在前面
    --------------------
    楼主给出的例子怎么是 升序呢?
      

  6.   

    那就再加一个order by 1