Solved

MySQL Group By

Posted on 2013-05-21
2
256 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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

15 Experts available now in Live!

Get 1:1 Help Now