【发布时间】:2011-06-20 22:54:26
【问题描述】:
编辑:专门讨论没有表的查询。是的,我可以使用存在,但我必须这样做
select case when exists (blah) then 1 else 0 end as conditionTrue
from ARealTableReturningMultipleRows
在 T-SQL 中我可以做到:
select case when exists(blah) then 1 else 0 end as conditionTrue
在 Oracle 中我可以做到:
select case when exists(blah) then 1 else 0 end as conditionTrue from DUAL
如何在 HQL 中实现相同的功能?
select count() 似乎是第二好的选择,但如果不需要,我不想处理表中的每一行。
【问题讨论】: