select distinct year from tb order by year desc

解决方案 »

  1.   

    select distinct year from tablename where conditon
      

  2.   

    还有一问要怎么实现统计(select distinct year from tablename where conditon)以后YEAR的个数???
      

  3.   

    $SQL="select distinct year from tablename where conditon";
    $result=mysql_query($SQL) or die(mysql_error()); 
    $row=mysql_fetch_Array($result); 
    用for循环统计row数组的个数就可以。 
      

  4.   

    那我要实现实现统计(select distinct year from tablename where conditon)以后YEAR的个数分页显示YEAR字段呢?
      

  5.   

    select year,count(*) from tablename where conditon group by year注:在mysql中year是不能做字段名的