티스토리 뷰

공부

[SQL] null order by

승가비 2019. 6. 29. 23:45
728x90

### MySQL


SELECT * FROM table ORDER BY field IS NULL ASC, field ASC

[출처] https://ismydream.tistory.com/158

// IS NULL ASC - NULL 앞쪽 배치

// IS NULL DESC - NULL 뒤쪽 배치

 

 

### Oracle

ORDER BY column DESC nulls first
ORDER BY column DESC nulls last
728x90
댓글