sql - Order Table by Column, but ignore if 0 - SQLite -


i have column called my_order. default 0. want in query:

order my_order (if not 0)

so if columns' data has 0, 0, 0, 2, 0, 1, resort 1, 2, 0, 0, 0, 0, (ignoring zeros).

obviously last part incorrect. how in sqlite?

my first 2 suspicions either coalesce or case.

you use case like:

select * tbl order case when my_order = 0 1 else 0 end, my_order 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -