数据库中sql语句如何使用between and查询某个时间段的数据
注意我的Source_Time字段是date类型的,那么我要根据该表的Source_Time字段查询数据,该如何查询呢?下面我给出sql,写的是一个连表查询,当然这都无所谓,重要讲的是如何根据该表的Source_Time字段进行查询数据select c.Rate_Valuefrom ZZ_CoalMiningRate cleft join zz_wor...
·
注意我的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
这辈子坚持与不坚持都不可怕,怕的是独自走在坚持的道路上!
欢迎加入技术群聊!
更多推荐
已为社区贡献1条内容
所有评论(0)