select z1,z2,z3,z4 from t order by decode(z3,null,0,1)
order中的decode是什么意思?
谢谢!

解决方案 »

  1.   

    order by decode(z3,null,0,1) 
    等价于
    if z3 is null then 
       order by 0
    else 
       order by 1
      

  2.   

    SELECT ..... order by 0
    但是没有第0列,会报错的呀!
      

  3.   

    意思是按z3的值排序,z3为null的排在前面,其他值排在后面
      

  4.   

    "意思是按z3的值排序,z3为null的排在前面,其他值排在后面"
    其他值排在后面,这些值排序吗?
      

  5.   

    非null的值不排序,因为那个decode将非null的都转为1了。