I have been banging my head around trying to come up with a query to display a datetime to show years -> months -> count(months with that year).
Example:
I want to show my results like this:
Year Mth #
2012 Apr 595
2012 Mar 27
2011 Oct 1
etc...
my table looks like this:
create table `log` (
`datetime` datetime ,
`username` varchar (75),
`clientaddr` varchar (225),
`action` varchar (75),
`details` varchar (300)
);
I want to show all the records in in the logs table as shown above. Anyone have any suggestions? Feel free to share an algorithm to do the same thing.
Thanks in advance 🙂
How about: