【发布时间】:2018-12-18 19:51:38
【问题描述】:
我想在 ORACLE 上使用 COUNT 结果作为 IF CONDITION,就像 oracle 上的这个伪代码:
select count(d.number_people) as counted_people
from dual d
if counted_people = 1 then
dbms_output.put_line('Have just one people on this column.'
end if;
这个语法是错误的,我知道,我该怎么做?
【问题讨论】:
-
DUAL 是一个特殊的单行一列的表,它没有
number_people列,使用@987654325 不清楚你想从这个表中统计多少人@ ? -
举个例子,问题是如何使用count as if语句
标签: sql oracle if-statement count