- 第一種寫法
SELECT "local_events".* FROM "local_events" WHERE (event_type is not null) ORDER BY event_type='01' DESC, event_type='02' DESC
- 第二種寫法
SELECT "local_events".* FROM "local_events" ORDER BY position(event_type::text in '01,02')
參考
SELECT "local_events".* FROM "local_events" WHERE (event_type is not null) ORDER BY event_type='01' DESC, event_type='02' DESC
SELECT "local_events".* FROM "local_events" ORDER BY position(event_type::text in '01,02')
參考