0

我正在计算会员注册的总年份。我需要返回结果,有多少会员注册超过 5 年,但运行代码时出现错误。

它在第 3 行显示“持续时间”无效标识符

select floor(months_between(SYSDATE,RegistrationDate)/12) as "Duration"

from member

where duration > 5;
4

1 回答 1

0

您可以使用子查询:

select *
from
(
    select floor(months_between(SYSDATE,RegistrationDate)/12) as "Duration"
    from member
)
where "Duration" > 5;
于 2019-04-04T14:56:28.893 回答