Hi,
Need suggestion for a query.
I am trying to get count(c3.id) for all days of feb.
As in cs.created_at some dates are missing.How can i use below clause.
group by day(cs.created_at)
something like group by day(month(cs.created_at)) not working..
select
count(case when cs.id IN(select max(id) from complaint3_status where complaint_id=c3.id and status_type=10) and cs.status_value=11 then c3.id end) as resolved_complaints
from
complaint3 c3 , complaint3_status cs, company c,complaint3_details cd,user3 u3
where
c3.id=cs.complaint_id
and cd.complaint_id=c3.id
and u3.id=c3.user_id
and c.id=c3.company_id
and c3.company_id=852
and month(cs.created_at)=02
and year(cs.created_at)=2014
**group by day(cs.created_at)**