我查詢可以使用MySQL,IFNULL()返回列值爲int的字符串嗎?
select cname, count(screening_occapancy.idclient) as 'Count'
from client, screening_occapancy
where client.client_no = screening_occapancy.idclient
group by cname
返回如下:
Name Count
Name1 2
Name2 3
Name3 6
等,現在我想在「計數」被「找不到」如果值爲null或0的值,是可能?我需要在我的結果類似的東西:
Name Count
Name1 2
Name2 3
Name3 "Not found"
標題問題的答案是肯定的:'ifnull(column,「Not Found」)' – Barmar