Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在MySQL中使用IsNull时参数不正确_Mysql_Join - Fatal编程技术网

在MySQL中使用IsNull时参数不正确

在MySQL中使用IsNull时参数不正确,mysql,join,Mysql,Join,我一直在尝试使用IsNull()函数来确保字段有一个值 SELECT crawled.id, IsNull(sranking.score,0) as Score, crawled.url, crawled.title, crawled.blurb FROM crawled LEFT JOIN sranking ON crawled.id = sranking.sid WHERE crawled.body LIKE '%".$term

我一直在尝试使用
IsNull()
函数来确保字段有一个值

SELECT crawled.id,
       IsNull(sranking.score,0) as Score,
       crawled.url,
       crawled.title,
       crawled.blurb
FROM crawled
    LEFT JOIN sranking ON crawled.id = sranking.sid
WHERE crawled.body LIKE '%".$term."%'
ORDER BY Score DESC LIMIT " . $start . "," . $c
但我得到了错误信息:

对本机函数“IsNull”的调用中的参数计数不正确


有人有什么想法吗?我是MySQL的新手

< P>您可以考虑使用<代码> CuuleSeC/ <代码>:

它返回第一个非null值。

测试传递的表达式是否为null。正如
xyld
所提到的,您需要的是合并

SELECT crawled.id, IFNULL(sranking.score, 0) as Score, ...