postgresql中根据条件创建一个虚拟字段。 条件是:如果id = 786168753672753152 就将marked字段设置为true否则设置为false,最后按照marked进行排序。
select name, id, case when id = 786168753672753152 then 'true' else 'false' end as marked from hiteam.space where finished = false order by marked desc;