- 第一种写法
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')
参考