こんな問い合わせがあります
select `temp`, IfNULL(count(id),0) t
from survey
where `temp`<>'NULL' and `temp`<> '' and date(submitdate)='date'
group by `temp
O/P付き
temp t
A1 1
しかし、レコードがない場合、選択した日付に何が起こるかを次に示します。結果が得られません。答えはA1、A2、A3のようなものです
このようなo/pが必要です
temp t
A1 1
A2 0
A3 0