group mysql results by year, list months
Posted: Mon Oct 04, 2010 3:21 pm
hey everybody,
i am trying to build a query and just can't quite get my head around it. I need to display press releases from a database, but, They need to be grouped by year, then display all the months. The data will be one press release per month, the date will be a datetime column called "created_at" and here is a visual example of how i want the output. e.g:
2010
january
february
march
etc..
2009
january
february
etc..
any help would be greatly appreciated!
i am trying to build a query and just can't quite get my head around it. I need to display press releases from a database, but, They need to be grouped by year, then display all the months. The data will be one press release per month, the date will be a datetime column called "created_at" and here is a visual example of how i want the output. e.g:
2010
january
february
march
etc..
2009
january
february
etc..
any help would be greatly appreciated!