【发布时间】:2015-04-29 04:48:05
【问题描述】:
在 MySQL 中,我可以选择这样的布尔表达式:
select (foo > bar and some = thing) as myFlag
...
但在其他 SQL 方言中(在我的例子中:Oracle PL/SQL 和 Hibernate HQL)它不起作用。
我发现的唯一解决方法是:
select case when (foo > bar and some = thing) then true else false end as myFlag
...
我觉得很丑。
有没有更好的方法来编写这样的表达式?
【问题讨论】:
标签: select plsql coding-style hql boolean-expression