Is this the correct syntax for SQLite for making nulls appear last?

后端 未结 3 550
北恋
北恋 2021-01-05 17:36
select * from table1
order by case Language when null then 1 else 0 end, Language

No matter which way I play around with it, it always displays nul

3条回答
  •  無奈伤痛
    2021-01-05 17:53

    You have to use the is operator when checking for null

    select * from table1
    order by case when Language is null then 1 else 0 end, 
             Language
    

提交回复
热议问题