在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, ...