当前位置:网站首页>Time field comparison time size in MySQL
Time field comparison time size in MySQL
2022-06-13 07:09:00 【CSDN Q & A】
You want to query a time field that is greater than 0 A point is less than the time between two points and more than the time after two points
select a.sqr ' Applicant ',h.lastname,a.sqrq ' Application date ',b.jbrq as ' Start date ',b.jsrq as ' End date ',
b.sjkssj as ' Actual start time ',b.sjjssj as ' The actual end time ',b.sjsc as ' Overtime hours ',
case b.sjjssj
when b.sjjssj >='00:00:00' and b.sjjssj <'02:00:00' then 50
when b.sjjssj >'02:00:00' then 80
end ' Overtime allowance '
from formtable_main_52 a
left join formtable_main_52_dt1 b on a.id = b.mainid
left join hrmresource h on h.id=a.sqr
left join workflow_requestbase w on a.requestid=w.requestid
where b.jsrq>b.jbrq and w.currentnodetype=3
But the result of the query :
287 Dai Xujun 2022-03-24 2022-03-15 2022-03-16 17:30 00:06 6 80
287 Dai Xujun 2022-03-24 2022-03-18 2022-03-19 17:31 00:30 6.5 80
284 Sun Hongwei 2022-03-24 2022-03-18 2022-03-19 17:07 00:38 7 80
284 Sun Hongwei 2022-03-24 2022-03-15 2022-03-16 17:30 00:06 6 80
285 Li Cailing 2022-03-24 2022-03-15 2022-03-16 17:30 00:06 6 80
285 Li Cailing 2022-03-24 2022-03-18 2022-03-19 17:38 00:40 6.5 80
260 Bian Youpeng 2022-04-02 2022-04-01 2022-04-02 17:00 02:30 9
41 Li Xiaowen 2022-04-02 2022-04-01 2022-04-02 17:20 03:00 9
315 Zhangyunfang 2022-04-02 2022-04-01 2022-04-02 17:00 03:00 9.5
303 Yu anyin 2022-04-02 2022-04-01 2022-04-02 17:00 03:00 9.5
Time comparison cannot be used > ,< This way of comparison , I tried in where Write directly after the condition b.sjjssj>'02:00' The result is correct ,
But in case when above then The result is wrong , What's the situation depressed
边栏推荐
- FSM状态机
- What does my financial product mean in clearing?
- Upper computer development (software test of firmware download software)
- Detailed Mr Atlas of hip joint (Reprinted)
- Why should two judgment expressions in if be written in two lines
- NFV基本概述
- 尝试使用RenderDoc查看UE的Shader代码
- 基于SSM实现水果商城批发平台
- What is the new business model of Taishan crowdfunding in 2022?
- 百货中心供应链管理系统
猜你喜欢

玄武云科技通过上市聆讯:业绩波动明显,陈永辉等三人为控股股东

2022 - 06 - 12: dans un échiquier carré n * N, il y a n * n pièces, donc chaque pièce peut avoir exactement une pièce. Mais maintenant quelques pièces sont rassemblées sur une grille, par exemple: 2 0

Learning notes of MySQL series by database and table

【ViveFocus使用WaveVR插件获取手柄操作事件】

测试开发程序员,你还在迷茫吗?不能把自己定义为码农......

树莓派高级开发——“IO口驱动代码的编写“ 包含总线地址、物理_虚拟地址、BCM2835芯片手册知识

Test development programmers, are you still confused? You can't define yourself as a yard farmer

Computer network interview questions

RT thread simulator lvgl control: slider control

基于ESP32CAM实现WebSocket服务器实时点灯
随机推荐
Quick sort
How to seize the bonus of social e-commerce through brand play to achieve growth and profit?
The innovative public platoon mode team invites users to split, beautiful every second, and links the 2+1 new business model
Uploading and retrieving stored images in localstorage
RT thread simulator lvgl control: switch switch button control
[cloud native | kubernetes] kubernetes configuration
Through the function seaborn cubehelix_ Palette build order palette
百货中心供应链管理系统
Database connection under WinForm
How to make a development board from scratch? Illustrated and illustrated, step by step operation for you to see.
我的理财产品显示清算中是什么意思?
RT thread simulator lvgl control: button button event
【RS-422与RS-485】RS-422与RS-485串行接口标准
Relevant knowledge under WinForm
如何从头自己制作开发板?图文并茂,一步步操作给你看。
Normalizing y-axis in histograms in R ggplot to proportion
RT-Thread 模拟器 simulator LVGL控件:slider 控件
基于SSM实现水果商城批发平台
Br backup test
TiDB Lightning