Solved

MySQL Group By

Posted on 2013-05-21
2
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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