select distinct datepart(year, 日期字段) from table或者select datepart(year, 日期字段) from table group by datepart(year, 日期字段)

解决方案 »

  1.   

    select distinct(left(字段,4)) from tablename
      

  2.   

    select distinct datepart(y, 日期字段) from tablename
      

  3.   

    select datepart(year, 字段) from table group by datepart(year, 字段)
      

  4.   

    select datepart(year, 字段) from table group by datepart(year, 字段)
      

  5.   

    SELECT  distinct DATEname(yy, 字段名字) from tablename
      

  6.   

    select distinct datepart(year, 日期字段) from table
      

  7.   

    SELECT  distinct DATEname(yy, 字段名字) as 年 from yourtable
      

  8.   

    --更正
    select distinct datepart(yy, 日期字段) from tablename
    or 
    select distinct left(convert(varchar(10),日期字段,120),4) from tablename
      

  9.   

    select distinct datepart(yy, 日期字段) from tablename
      

  10.   

    select distinct datename(year,日期字段) from tablename
      

  11.   

    select distinct datepart(yy, 日期字段) from tablename