I try the following SQL STATEMENT QUERY :
SELECT COUNT(status) as tot,
CASE WHEN (status = 'pending')
THEN COUNT(status) ELSE 0 END pct,
CASE WHEN (status = 'rejected')
THEN COUNT(status) ELSE 0 END rct,
CASE WHEN (status = 'active')
THEN COUNT(status) ELSE 0 END act,
CASE WHEN (status = 'disabled')
THEN COUNT(status) ELSE 0 END dct
FROM committees
What wrong with the query above because I get the following error below.
The error I get
SQLSTATE[42000]: Syntax error or access violation: 1140 In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'house.committees.status'; this is incompatible with sql_mode=only_full_group_by
Am using PDO and my sql version is 5.7.14 Though I just upgraded from 5.6.17
group byclause. - dns_nx