注册

if 函数不支持判空,改为case when也不行

hh 2023/04/27 1127 4

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: dm8
【操作系统】: win11
【CPU】: 锐龙5800h
【问题描述】*:
sql 执行报错,if 函数不支持判空,改为 case when 也不行。

SELECT
	IF ( a.sell_amount != NULL,
	a.total_amount != NULL,
	a.total_amount - a.sell_amount)
FROM
	tbl_plant_plan_sell_agri a
WHERE
	a.plant_plan_id = 12

在 MySQL 中是可以正常执行的,请问在达梦中要怎么改写?

回答 0
暂无回答
扫一扫
联系客服