当前位置:网站首页>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
边栏推荐
- 基于FPGA的ds18b20温度传感器使用
- Eureka server multi node deployment
- Tidb statistics
- AIO Introduction (VIII)
- powerdisgner逆向生成oracle数据模型
- Uploading and retrieving stored images in localstorage
- RT-Thread 模拟器 simulator LVGL控件:slider 控件
- 数字时代进化论
- An example of CSRF attack defense in web application scenarios
- RT thread simulator lvgl control: button button style
猜你喜欢

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

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

Tidb grafana reverse proxy

Computer network interview questions

It's called the next generation monitoring system. Let's see how awesome it is

Try to use renderdoc to view the shader code of UE

Byte (nine)

2022-06-12:在N*N的正方形棋盤中,有N*N個棋子,那麼每個格子正好可以擁有一個棋子。 但是現在有些棋子聚集到一個格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二維數組代錶,一

What is the new business model of Taishan crowdfunding in 2022?

Upper computer development (detailed design of firmware download software)
随机推荐
Introduction and use of dumping
关于#数据库#的问题:PGADMIN4 编辑sql窗口问题
Project analysis of Taishan crowdfunding mode: why is Taishan crowdfunding mode so popular?
The biggest highlight of wwdc2022: metalfx
全志V3S环境编译开发流程
【ViveFocus使用WaveVR插件获取手柄操作事件】
RT-Thread 模拟器 simulator LVGL控件:button 按钮事件
How worker threads in the thread pool are recycled
[Markov chain Monte Carlo] Markov chain Monte Carlo method sampling prior distribution
Priority analysis of list variables in ansible playbook and how to separate and summarize list variables
髋关节MR详细图谱(转载)
RT thread simulator lvgl control: switch switch button control
Tidb dashboard modify port
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
I always don't understand the high address and high position
Why should two judgment expressions in if be written in two lines
Xiaomi's one-sided interview questions (self sorting answers)
FTP_ Manipulate remote files
mysql中时间字段 比较时间大小
MongoDB系列之SQL和NoSQL的区别