当前位置:网站首页>How to get the maximum value of column two and regenerate the table when the SQL Server column one is the same
How to get the maximum value of column two and regenerate the table when the SQL Server column one is the same
2022-07-01 10:23:00 【CSDN Q & A】
I have a database in the following format :
SourceName TimeStamp Status Path1 Path2
Alarm1 20220101 1 Street1 Street1_1
Alarm1 20220102 0 Street1 Street1_1
Alarm1 20220103 1 Street1 Street1_1
Alarm2 20220101 0 Street1 Street1_1
Alarm2 20220301 1 Street1 Street1_1
Alarm3 20220301 1 Street1 Street1_1
Alarm3 20220501 1 Street1 Street1_1
The first step is to filter out the following table
SourceName TimeStamp Status
Alarm1 20220101 1
Alarm1 20220102 0
Alarm1 20220103 1
Alarm2 20220101 0
Alarm2 20220301 1
Alarm3 20220301 1
Alarm3 20220501 1
The second step , In the same case , Take the maximum value of column 2
Expected results
SourceName TimeStamp Status
Alarm1 20220103 1
Alarm2 20220301 1
Alarm3 20220501 1
Want to know how to write such a filter SQL sentence , thank you
边栏推荐
- Tryhackme Christmas challenge 2021 advance of cyber 3-day1-idor vulnerability, insecure access control vulnerability
- 《天天数学》连载55:二月二十四日
- 缺少比较器,运放来救场!(运放当做比较器电路记录)
- 关于#SQL#的问题,如何解决?
- Suggest collecting | what to do when encountering slow SQL on opengauss?
- C# 一行代码计算文件的MD5值 - CodePlus系列
- 新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
- How to solve the problem of SQL?
- SQL optimization - in and not in, exist
- sql语句修改字段类型「建议收藏」
猜你喜欢

新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求

Have you learned the necessary global exception handler for the project

Live broadcast management project

Zero foundation software testing must see, 10 years of testing old bird's conscience suggestions (a total of 15)

Recommend a JSON visualization tool artifact!
![[MPC] ① quadratic programming problem matlab solver quadprog](/img/be/5e300255041e3348b933bc32e2ea46.png)
[MPC] ① quadratic programming problem matlab solver quadprog

If you meet a female driver and drive didi as an amateur, you can earn 500 a day!

leetcode:111. 二叉树的最小深度

A quietly rising domestic software, low-key and powerful!

bash: ln: command not found
随机推荐
The stock position building rate of global funds and asset management reached a new low in 15 years
SQL optimization - in and not in, exist
数据库的增删改查问题
Simulink simulation circuit model of open loop buck buck buck chopper circuit based on MATLAB
The programmer was beaten.
442. duplicate data in array
Po mode deep encapsulation
How to solve the problem of SQL?
【黑马早报】俞敏洪称从来不看新东方股价;恒驰5将于7月开启预售;奈雪虚拟股票或涉嫌非法集资;7月1日起冰墩墩停产...
Floyd repeat
Matplotlib数据可视化基础
BSN long story 10: how to ensure the safety of NFT
In the new database era, don't just learn Oracle and MySQL
Button button clear border
What if the win11 account is locked and unable to log in? Win11 account is locked and unable to log in
Graduation summary of actual combat camp
12款大家都在用的产品管理平台
编写自己的who命令
问下群里的各位,有使用flink oracle cdc的logminer方案,在生产上稳定运行的实际
C# 一行代码计算文件的MD5值 - CodePlus系列