mysql - How to return SQL rows with the largest year from date field only? -


so have multiple fields in database , 1 of date. date field of date datatype , need return values have largest year value within date field.

so far i've done this:

$files = mysql_query("select * files unpublish=0 , year(date) order files.date desc"); 

now it's not enough, how force treat year(date) return largest values?

select * files  unpublish=0  , year(date)=(select max(year(date)) files)  order files.date desc 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -