April 13th, 2013, 03:59 AM
SELECTing AVG(DATE) from a table
There is a table with a column type DATE. Values there are as expected for example: 2014-12-12
What is the corect way to get the average of the dates? Obvously this is not the right approach
WHERE date > '2004-12-12'
April 13th, 2013, 04:05 AM
please explain what you mean by "average date"
April 13th, 2013, 05:37 AM
Hi Rudy how are you?
Lets say there are 1 million entries each have a submition date. Could be anything from 1990 up to 2012.
Originally Posted by r937
I want to find out what year had the most submitions. Please note that the date formats are 'yyyy-mm-dd'.
2 - Also I am having a strange experince! Adding index on a DATE column made things much slower than usual!
April 13th, 2013, 06:04 AM
this is not the same as "average date"
Originally Posted by zxcvbnm
SELECT YEAR(submissiondate) AS theyear
BY COUNT(*) DESC
April 13th, 2013, 06:27 AM
The lesson: Get creative.