i want to sort with SQLITE so my data will show like this:
- First sort by year asc, then alphabetic
- If year is null then alphabetic desc
My ideas was :
ORDER by CASE WHEN year = NULL then Name Else year, name
ORDER by YEAR NULLS LAST
, IIF(year != NULL, name, name desc) ;
But it does not work. I got an error. Do you have some ideas?

You should always compare to
NULLwith the operatorISand never with=.SQLite supports the
NULLS LAST/FIRSTclause since version 3.30.0.If your version supports it then you can use:
If you use an older version you can use a boolean expression:
or a
CASEexpression:See the demo.