当前位置:网站首页>Find the latest staff salary and the last staff salary changes
Find the latest staff salary and the last staff salary changes
2022-08-11 07:52:00 【A little birds】
There is such a demand to find the latest salary situation and the second latest salary situation of personnel, and then calculate an increase situation
The database used is mysql database
The form used is as follows:
Personnel list:listuser
Payroll:ry
sql display
Query the latest data according to time
SELECT a.id,a.dy_id,a.gz,max(a.time) from ry a GROUP BY dy_id
Query the second latest data according to time
SELECT a.id,a.dy_id,a.gz,a.time from ry a where a.id=( SELECT id from ry where a.dy_id=dy_id ORDER BY time LIMIT 1,1 )
Then you can perform a related query
边栏推荐
- 分布式锁-Redission - 缓存一致性解决
- 测试用例很难?有手就行
- 【LeetCode】Summary of linked list problems
- LeetCode brushing series -- 46. Full arrangement
- Item 2 - Annual Income Judgment
- 1036 Programming with Obama (15 points)
- 1051 复数乘法 (15 分)
- 计算YUV文件的PSNR与SSIM
- 1003 I want to pass (20 points)
- 【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
猜你喜欢
tf.reduce_mean()与tf.reduce_sum()
1096 big beautiful numbers (15 points)
JRS303-数据校验
Conditional statements in TF; where()
Serverless + domain name can also build a personal blog? Really, and soon
1046 punches (15 points)
1101 How many times B is A (15 points)
1003 我要通过 (20 分)
1096 大美数 (15 分)
Use tf.argmax in Tensorflow to return the index of the maximum value of the tensor along the specified dimension
随机推荐
linux 安装mysql服务报错
1091 N-Defensive Number (15 points)
TF中的条件语句;where()
JUC并发编程
计算YUV文件的PSNR与SSIM
详述 MIMIC护理人员信息表(十五)
Test cases are hard?Just have a hand
prometheus学习4Grafana监控mysql&blackbox了解
语音信号处理:预处理【预加重、分帧、加窗】
The most complete documentation on Excel's implementation of grouped summation
js根据当天获取前几天的日期
Conditional statements in TF; where()
Douyin API interface
项目2-年收入判断
1096 big beautiful numbers (15 points)
3GPP LTE/NR信道模型
结合均线分析k线图的基本知识
1003 I want to pass (20 points)
tf.reduce_mean() and tf.reduce_sum()
1003 我要通过 (20 分)