Solved

MySQL Group By

Posted on 2013-05-21
2
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now