LMSouq
general-dev Open

Group by date only on a Datetime column

FM
fmsf
1 month ago
3 views
Problem Description
Having a table with a column like: `mydate DATETIME` ... I have a query such as: SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate; This will group by the full `datetime`, including hours and minutes. I wish to make the group by, only by the date `YYYY/MM/DD` not by the `YYYY/MM/DD/HH/mm`. How to do this?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base