SQL中怎样排出年份的影响,按照月份、日期进行排序?
请指教,谢谢!

解决方案 »

  1.   

    用函数取字符
    只取日期和月份来排序SUBSTRING
      

  2.   

    declare @t table(data datetime)
    insert @t select '1981-01-21'
    union all select '1979-03-04'
    union all select '1978-02-23'
    union all select '1984-12-14'
    select * from @t order by month(data),day(data)
      

  3.   

    直接对datetime类型作排序应该可以么
      

  4.   

    order by convert(varchar(10),[date],120)
    的形式可以么