i have a query like below.
SELECT occupation AS \'Contact occupation\', sum(total) AS \'Quantity\' FROM ( SELECT CASE WHEN patients.created_at IS EQUALS THEN