SELECT DISTINCT For Month and Year?
I am using ASP with MySQL. I want to only display 1 record for each month and year.
For Example I want it to show:
» February 2005
» January 2005
» December 2004
» November 2004
But right now it is displaying all the entries like this:
» February 2005
» February 2005
» February 2005
» February 2005
» February 2005
» January 2005
» January 2005
» January 2005
» January 2005
I have tried the: mySQL = "SELECT DISTINCT * FROM table"
But because I am calling the date and month but not the day I think this will not work. For example a date looks like 2004-12-25, and the next one 2004-12-26. But I want only a DISTINCT record for the 2004-12.
Is this possible? If so how?
Thanks,
- James
Subject
Written By
Posted
SELECT DISTINCT For Month and Year?
February 08, 2005 10:29AM
February 08, 2005 12:44PM
February 10, 2005 09:46AM
February 10, 2005 10:00AM
February 11, 2005 10:15AM
February 11, 2005 11:20AM
February 11, 2005 11:33AM
February 15, 2005 10:33AM
February 15, 2005 12:34PM
February 16, 2005 11:32AM
February 16, 2005 05:00PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.