当前位置:网站首页>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
边栏推荐
- Four startup modes of Activity
- 1071 Small Gamble (15 points)
- JRS303-Data Verification
- linux 安装mysql服务报错
- 我的创作纪念日丨感恩这365天来有你相伴,不忘初心,各自精彩
- 数仓开发知识总结
- Douyin API interface
- Internet phone software or consolidation of attack must be "free" calls security clearance
- C语言每日一练——Day02:求最小公倍数(3种方法)
- [Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering
猜你喜欢
随机推荐
Pico neo3 Unity打包设置
【软件测试】(北京)字节跳动科技有限公司终面HR面试题
Taobao product details API interface
Edge provides label grouping functionality
欢迎加入sumarua网络安全交流社区
【Pytorch】nn.ReLU(inplace=True)
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
How do you optimize the performance of your Unity project?
Write a resume like this, easy to get the interviewer
[Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering
1003 I want to pass (20 points)
项目2-年收入判断
matplotlib
C语言每日一练——Day02:求最小公倍数(3种方法)
梅科尔工作室——BP神经网络
3GPP LTE/NR信道模型
1096 大美数 (15 分)
There may be fields that cannot be serialized in the abnormal object of cdc and sqlserver. Is there anyone who can understand it? Help me to answer
【LeetCode】Summary of linked list problems
查找最新人员工资和上上次人员工资的变动情况