Answer the question
In order to leave comments, you need to log in
How to count the total number of people from one date?
I have a database.
I need to query the total number of people (num_psng) per month (date_flying)
For example, for May it turns out 75.
How can I do this?
Answer the question
In order to leave comments, you need to log in
If by day, then
SELECT date_fluing, SUM(num_psng) FROM ... GROUP BY date_fluing
SELECT DATE_FORMAT(date_fluing, '%Y-%m'), SUM(num_psng) FROM ... GROUP BY DATE_FORMAT(date_fluing, '%Y-%m')
SELECT SUM(num_psng) FROM ... WHERE DATE_FORMAT(date_fluing, '%Y-%m') = '2017-05'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question