当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Activity的四种启动模式
golang fork 进程的三种方式
About # SQL problem: how to set the following data by commas into multiple lines, in the form of column display
Pico neo3 Unity打包设置
oracle19c不支持实时同步参数,请教一下大佬们有什么好的解决办法吗?
Evolution and New Choice of Streaming Structured Data Computing Language
接口测试的基础流程和用例设计方法你知道吗?
SQL sliding window
2022-08-10 mysql/stonedb-慢SQL-Q16-耗时追踪
【LeetCode】链表题解汇总
Four operations in TF
1046 划拳 (15 分)
1071 小赌怡情 (15 分)
【Pytorch】nn.PixelShuffle
无服务器+域名也能搭建个人博客?真的,而且很快
联想集团:2022/23财年第一季度业绩
My creative anniversary丨Thank you for being with you for these 365 days, not forgetting the original intention, and each is wonderful
Internet phone software or consolidation of attack must be "free" calls security clearance
prometheus学习5altermanager
易观分析联合中小银行联盟发布海南数字经济指数,敬请期待!