Good day,
I have compiled the following query.
SELECT
COUNT(CASE WHEN `booking_creationdate` LIKE \'2020-01-31%\' THEN 1 END) AS 2020-01-31,
COUN
I guess there is problem with quotes in query : Try below:
SELECT
COUNT(CASE WHEN booking_creationdate LIKE '2020-01-31%' THEN 1 END) AS "2020-01-31",
COUNT(CASE WHEN booking_creationdate LIKE '2020-02-05%' THEN 1 END) AS "2020-02-05"
FROM bookingstable AND booking_location = 4
-
isn't allowed in identifiers unless the identifier is enclosed in back ticks. So instead of
... AS 2020-01-31
write
... AS `2020-01-31`
and analog for all other cases. Or use another alias without -
.
Side note: It seems like booking_creationdate
is a string. That's the wrong data type. Use some date/time data type.