select 的问题,找寻一月至今三月的记录   对应的列为date 格式为2006-??-??

解决方案 »

  1.   

    select * from ?? where 就是这个后面怎么表明 “至”这个意思  一月至三月
      

  2.   

    select * from ?? where col_date between '2006-5-6' and '2007-3-6'
      

  3.   

    where YEAR(date)=YEAR(getdate()) and MONTH(date)>=1 and MONTH(date)<(MONTH(getdate())-3)
      

  4.   

    select * from tablename where col between '2006-01-01' and '2006-03-31'
      

  5.   

    樓上要加case,因為MONTH(getdate())-3<0
      

  6.   

    因為可能MONTH(getdate())-3<0
      

  7.   

    如果只判断 月份呢
    就是between 后面 判断月分在一月至三月 和年 日没关系
    select 获得月份的函数是?