select distinct year from ...where...;

解决方案 »

  1.   

    select distinct year from table
      

  2.   

    我觉得贴主的意思是按year来分组统计。
    select year from tbname group by year
      

  3.   

    what's the difference between 
    1. select year from tbname group by year
    2. select distinct year from table  Output Exact same , But 1 will be slow 
      

  4.   

    select distinct year from table
      

  5.   

    distinct就是排除结果集中相同的条目
      

  6.   

    select distinct year from table order by year
      

  7.   

    select distinct year from table order by year
    =
    select distinct year from table
      

  8.   

    Select Year from table group by year
      

  9.   

    select distinct year from table 
    order by year asc
      

  10.   

    select distinct year from table 
    order by year asc;
    Select Year from table group by year;都可以前者速度要快,后者可以做统计:加上sum函数
    ================================================================
    ★★ chen_cyh(逐波流) ●