为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM7
【操作系统】:Linux
【CPU】:
【问题描述】*:
sql场景
下面的语句是可以正常执行的,其中注释掉的语句和select后的是一样的,证明这个写法是没问题的
select
trunc(months_between(now(), concat(c.birth_date_year, '-', c.birth_date_month, '-01')) / 12)
from
CADRE_BASIC_INFO c
where
c.birth_date_year is not null
and c.birth_date_year != ''
and c.birth_date_month is not null
and c.birth_date_month != ''
-- and trunc(months_between(now(), concat(c.birth_date_year, '-', c.birth_date_month, '-01')) / 12) > 65
select
trunc(months_between(now(), concat(c.birth_date_year, '-', c.birth_date_month, '-01')) / 12)
from
CADRE_BASIC_INFO c
where
c.birth_date_year is not null
and c.birth_date_year != ''
and c.birth_date_month is not null
and c.birth_date_month != ''
and trunc(months_between(now(), concat(c.birth_date_year, '-', c.birth_date_month, '-01')) / 12) > 65
CADRE_BASIC_INFO 表结构的文本贴一下