Solved

MySQL Group By

Posted on 2013-05-21
2
259 Views
Last Modified: 2013-05-21
I have a column with a datatype of DATETIME

I require this as the application requires the date and time in the record, same column

My problem is I want to run a query to group the records by date, it is grouping each row as they all have a diffrent time value (obviously). I want to group by the date only.
0
Comment
Question by:Brogrim
2 Comments
 
LVL 20

Accepted Solution

by:
dsacker earned 500 total points
ID: 39184831
Hopefully this example will help:
select  date(DatetimeColumn),
        sum(ColumnToSum)
from    tablename
group by date(DatetimeColumn)

Open in new window

0
 

Author Closing Comment

by:Brogrim
ID: 39184941
Thanks
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question