Incorrect parameters in the call to native function 'iFnull'

本文详细解析了一段SQL代码中出现的括号缺失错误,并提供了正确的代码示例。通过对比错误和正确的代码,读者可以理解SQL语法中括号使用的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误代码

select ROUND(IFNULL(sum(shc.price) /(select sales_area from scheme_house_type_rel where id = '61e270639e46441b90f372bf7d0d2d7f'),0),2) as hardCoverPrice
    from scheme_scheme ss
    LEFT JOIN scheme_hard_cover shc on shc.scheme_id = ss.id and shc.state = 1
    LEFT JOIN scheme_house_type_rel shtr on shtr.scheme_id = ss.id
    where ss.state !=0 and ss.id = 'd08e4f9ed36d419eb1cf7481155ec9e8'

原因分析:少了个括号,哈哈哈哈,一定要仔细看清楚了

正确代码

 select ROUND(IFNULL((sum(shc.price) /(select sales_area from scheme_house_type_rel where id = '61e270639e46441b90f372bf7d0d2d7f')),0),2) as hardCoverPrice
    from scheme_scheme ss
    LEFT JOIN scheme_hard_cover shc on shc.scheme_id = ss.id and shc.state = 1
    LEFT JOIN scheme_house_type_rel shtr on shtr.scheme_id = ss.id
    where ss.state !=0 and ss.id = 'd08e4f9ed36d419eb1cf7481155ec9e8'

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

安逸的程序猿

意思不意思那是你的意思我没意思

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值