Hi,
I necessary to create one query that it catches the field date of mysql and groups per years and months.
I go to explain better what I need:
I have that to create a list that only consists the months and the years of a table of news.
in this table I the same have some entrances of dates with different days of month, year.
Ex.
2006-01-01
2006-01-02
2006-01-03
2006-02-01
2006-02-02
2006-02-03
...
and i need to output only
2006-01
2006-02
....
Some one cam help-me...thanks
Group Date Field
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
An EXTRACT() call combined with GROUP BY or DISTINCT would work.
http://dev.mysql.com/doc/refman/4.1/en/ ... #id2920219
http://dev.mysql.com/doc/refman/4.1/en/ ... #id2920219
-
DanielDrummond2k6
- Forum Newbie
- Posts: 2
- Joined: Fri May 26, 2006 9:05 am