[thelist] CF & SQL: Selecting unique months from date column

Tab Alleman Tab.Alleman at MetroGuide.com
Fri Jul 18 08:33:00 CDT 2003

Joshua Olson wrote:

>> SELECT Month(DateColumn), Year(DateColumn)
>> FROM TableName
>> GROUP BY Year(DateColumn), Month(DateColumn)
>> (the order of the GROUP BY clause is important)

> Why is the ordering in the GROUP BY clause important in this query?

Oops, it isn't.. I was confusing it with an ORDER BY clause.

More information about the thelist mailing list