使用函数Year及CurDate的组合: Year(CurDate())

select      date_format(min(date),'%Y-%m-%d') as mindate,
            date_format(max(date),'%Y-%m-%d') as maxdate,
            weekofyear(date) as weekyear,
            format(sum(hours),2) as sumhours 
from 
            daywork 
where 
            userid='myid' 
            and date_format(date,'%Y')=Year(CurDate()) 
group by    weekyear 
order by    weekyear

 

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-01-21
  • 2022-02-08
  • 2022-02-06
  • 2022-01-10
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-02-20
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案