1582 - Incorrect parameter count in the call to native function 'ISNULL',

时间:2018-07-22 16:14:11   收藏:0   阅读:3629

错误代码:

SELECT SNUM,AVG(ISNULL(SCORE,0)) FROM SC
WHERE SNUM IN
(
select SNUM from sc 
where score < 90 
group by SNUM 
having count(*)>2)
GROUP BY SNUM

错误提示:

1582 - Incorrect parameter count in the call to native function ‘ISNULL‘,

错误原因:

mysql识别不了ISNULL,支持IFNULL,

修改后代码:

SELECT SNUM,AVG(IFNULL(SCORE,0)) FROM SC
WHERE SNUM IN
(
select SNUM from sc 
where score < 90 
group by SNUM 
having count(*)>2)
GROUP BY SNUM

 运行无误!

原文:https://www.cnblogs.com/laochoubiji/p/9350241.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!