sql获取当月的数据

获取当月的数据,begin为参数'2021-04-01',end为'2021-04-30',sql如下:

select * from table_a where CONVERT(varchar(100), date_a, 23)  >= #{begin} and  CONVERT(varchar(100), date_a, 23) <= #{end}

其中date_a是表中的字段;

posted @ 2021-04-30 11:03  丙炎  阅读(701)  评论(0)    收藏  举报