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
Post a Comment