SQL:OrderBy
lastmod 2024-12-06created 2024-12-063 edits
Caveats
A column created with AS can be named with a string, but that string must not be used as-is in Order by.
At least it does not work in sqlite.
The statement below does not work.
select
substr(ci.heat_text, 1, 2) as 'header.lane'
from charging_info as ci
order by 'header.lane' -- 문자열을 적으면 안된다.
It must be changed as below.
Specifying NULL position
- (Database) Sorting Oracle NULL values with ORDER BY(NULLS FIRST, NULLS LAST) ! : Naver Blog
- NULLS FIRST
- NULLS LAST
See also
Pages that link here