Query question



Hi,

I have a MySQL database with a date field and a bunch of other fields. The
date field is in the format - 01/01/2006. What I want to do is query the
database and create a table that shows just the year and how many instances
of the year there is. I have been taxing my brain for a simple solution, but
just not getting it. Any suggestions?

Thanks

Example output.

Year Count

2002 5
2003 8
2004 9
2005 15
2006 22

ps - I get this information sent to me and I can't change any of the data. I
just enter it in the db and then hopefully do the query on it.




Relevant Pages

  • Re: function does not return
    ... Some servers will put slashes on returning data, ... The exception to this is if you called addslashes() before you inserted the data in the MySQL database. ... The ifstatement probably made sense years ago, before the query was assigned the line before. ...
    (alt.php)
  • Re: How do mysql_fetch_assoc/mysql_query work?
    ... When I submit a query using PHP I ... at least the data I want) in an array. ... I submit a query to a MySQL database it goes away, ... What language are you using? ...
    (comp.lang.php)
  • Re: How do mysql_fetch_assoc/mysql_query work?
    ... Jerry Stuckle wrote: ... When I submit a query using PHP I ... Maybe you don't want a 2D array? ... I submit a query to a MySQL database it goes away, ...
    (comp.lang.php)
  • Getting this week from database?
    ... Dear Folks and Friends, ... I screwed up somewhere and had this code working before, but now, ... I have a simple MySql database which has ... the query returns no data at all. ...
    (alt.php)
  • Need help with multiple criteria query
    ... I am struggling with creating a search on multiple criteria of a ... MySql database. ... Query: ... you account for this in the query. ...
    (php.general)