如何只获取工作时间的数据
有没有办法只选择或查询工作时间的数据?
id | 说明 | datetime |
---|---|---|
1 | 警报激活 | 2022-01-02 14:00:00 |
2 | 警报停用 | 2022-01-02 15:00:00 |
3 | 警报激活 | 2022-01-03 18:00:00 |
.. | 警报激活 | 2022-01- 31 11:00:00 |
我想知道电话号码闹钟在周一至周五上午 8 点至下午 5 点的工作时间内启动。
我尝试使用中间日期但没有成功。
Is there a way to select or query the data only on working hours?
id | description | datetime |
---|---|---|
1 | Alarm Activated | 2022-01-02 14:00:00 |
2 | Alarm Deactivated | 2022-01-02 15:00:00 |
3 | Alarm Activated | 2022-01-03 18:00:00 |
.. | Alarm Activated | 2022-01-31 11:00:00 |
I'd like to get the number of the alarm activated on or during working hours from mon-fri 8am to 5pm.
I tried to use the between date but no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里我们使用以下测试:
db<>fiddle 此处
Here we use the following tests:
db<>fiddle here