count (*)가 NULL이면 쿼리를 수정하여 0을 반환 할 수 있습니까?count (*)가 NULL 인 경우 0을 반환합니다.
select monthname(timestamp), year(timestamp), count(*)
from largehits
where largeID = someid
and (month(timestamp)<=somemonth
and month(timestamp)>=somemonth
and year(timestamp)<=someyear
and year(timestamp)>=someyear)
group by month(timestamp), year(timestamp)
order by timestamp asc
고마워요!
'COUNT()'는 절대로 NULL을 반환 할 수 없습니다. – BoltClock
다른 의미입니까? COUNT()가 0을 반환하면 NULL을 반환합니까? 간단한 사례가 당신을 위해 그것을 할 것입니다. 그 이유는 무엇인지 모르겠다. – manneorama
나는 당신이 맞을 가능성이 더 높다고 생각하는 것은 달/년 콤보가 존재하지 않아 누락 된 행을 얻는다는 것인가? – Basic