Answer the question
In order to leave comments, you need to log in
Counting the same values for some period?
There is a working request
SELECT text,count(*) as 'A'
FROM all_queries
group by text
having text in ('Привет','Хэллоу','Здравствуйте')
ORDER BY A desc
SELECT text,dates,count(*) as 'A'
FROM all_queries
group by text
having dates > LAST_DAY(CURDATE()) + INTERVAL 1 DAY - INTERVAL 1 MONTH
AND dates < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY)
AND text in ('Привет','Хэллоу','Здравствуйте')
ORDER BY A desc
Answer the question
In order to leave comments, you need to log in
If there is a GROUP BY in the query, then only the names of those attributes that are specified in the GROUP BY or aggregate functions can be specified after SELECT.
SELECT text, count(*) as 'A'
FROM all_queries
WHERE dates > LAST_DAY(CURDATE()) + INTERVAL 1 DAY - INTERVAL 1 MONTH
AND dates < DATE_ADD(LAST_DAY(CURDATE()), INTERVAL 1 DAY)
group by text
HAVING text in ('Привет','Хэллоу','Здравствуйте')
ORDER BY A desc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question