I have this table
id empid reaction date_t
1 emp090 not_interested 2017-09-16
2 emp090 not_interested 2017-09-16
I am looking to count the number of reaction as per the empid
and date_t
.
I have tried this query
SELECT c.COUNT(reaction) as interested,c.empid FROM `cases` c
WHERE c.reaction="interested" and c.empid="EMP12654"
AND c.date_t BETWEEN "2017-09-15" AND "2017-09-18"
INNER JOIN
( SELECT cases.empid COUNT(reaction) not interested FROM `cases`
WHERE cases.reaction="not_interested" and cases.empid="EMP12654"
AND cases.date_t BETWEEN "2017-09-15" AND "2017-09-18" )
AS alpha on alpha.empid=c.empid;
Can anyone tell me how to do it correctly?