在这里插入图片描述
注意我的Source_Time字段是date类型的,那么我要根据该表的Source_Time字段查询数据,该如何查询呢?

下面我给出sql,写的是一个连表查询,当然这都无所谓,重要讲的是如何根据该表的Source_Time字段进行查询数据

  select c.Rate_Value
        from ZZ_CoalMiningRate c
        left join zz_workface w
        on c.Workface_Id=w.Workface_Id
        where  w.Workface_Id = '910b434b-7a15-4bc3-93f0-c129eb05c4f8'
        and c.Rate_Type = '2'
        and c.Source_Time between '2019-07-08' and '2019-10-31'
         and w.Workface_Type=0

在这里插入图片描述
这辈子坚持与不坚持都不可怕,怕的是独自走在坚持的道路上!

欢迎加入技术群聊!

在这里插入图片描述

更多推荐