当前位置:网站首页>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
边栏推荐
- Graduation summary of actual combat camp
- Initial experience of Flink, a mainstream real-time stream processing computing framework
- Recommend a JSON visualization tool artifact!
- 请问有没有人知道clickhouse 中 limit语句执行的逻辑,图片中,上面的SQL可以执行成功
- Which securities company has a low, safe and reliable Commission for stock trading and account opening
- 亿学学堂帮个人开的证券账户安全吗?是不是有套路
- mysql截取_mysql截取字符串的方法[通俗易懂]
- Eat a rich woman's melon...
- 数字藏品平台搭建需要注意哪些法律风险及资质?
- What a high commission! The new programmer's partner plan is coming. Everyone can participate!
猜你喜欢
渗透常用工具-Goby
[MPC] ① quadratic programming problem matlab solver quadprog
C [byte array] and [hexadecimal string] mutual conversion - codeplus series
Error: missing revert data in call exception
Today in history: the semiconductor war in the late 1990s; Von Neumann published the first draft; CBS acquires CNET
CodeBlocks 左侧项目栏消失,workspace 自动保存项目,Default workspace,打开上次的workspace,工作区(图文教程,已解决)
谁还在买“三只松鼠”们
The Lantern Festival is held on the fifteenth day of the first month, and the Lantern Festival begins to celebrate the reunion
这样理解mmap,挺有意思!
12款大家都在用的产品管理平台
随机推荐
Finally, someone made it clear what DRAM and NAND flash are
渗透常用工具-Goby
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
关于OpenCV中图像的widthStep
TC8:UDP_USER_INTERFACE_01-08
程序员都想去国企?技术落后薪资低,躺平几年出来都找不到工作...
数字藏品市场新局面
Today in history: the semiconductor war in the late 1990s; Von Neumann published the first draft; CBS acquires CNET
Live broadcast management project
请问有没有人知道clickhouse 中 limit语句执行的逻辑,图片中,上面的SQL可以执行成功
sql语句修改字段类型「建议收藏」
建议收藏 | 在openGauss上遇到慢SQL该怎么办?
MySQL common commands
新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
Error: missing revert data in call exception
华为HMS Core携手超图为三维GIS注入新动能
Ubuntu system installation and MySQL configuration
12. Gateway new generation gateway
缺少比较器,运放来救场!(运放当做比较器电路记录)
The programmer was beaten.