【发布时间】:2018-07-17 15:41:32
【问题描述】:
如何将基于条件的选择添加到理论查询构建器?
我想复制类似这样的 SQL:
select p.id, p.id = 3 as first_result
from problem p
order by first_result desc, p.id
【问题讨论】:
-
是否需要在选择部分单独列,或者您只需要根据
p.id = 3对结果进行排序? -
不需要单独的选择结果——我在 SQL 中就是这样做的