oracle 數據庫 order by 排序的使用

order by 排序

    ORDER BY _column1, _column2; /* _column1升序,_column2升序 */  

   ORDER BY _column1, _column2 DESC; /* _column1升序,_column2降序 */ 

   ORDER BY _column1 DESC, _column2 ; /* _column1降序,_column2升序 */ 

   ORDER BY _column1 DESC, _column2 DESC; /* _column1降序,_column2降序 */


如果  排序的值爲null  怎麼辦?

 oracle 中 字段爲null 則默認排最後面  

 order by  column  desc   nulls first    /* 空值排最前面  同理 last 排最後面*/ 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章