当前位置:网站首页>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
边栏推荐
- Project0: Games
- How to understand JS promise
- CRC verification
- 【MPC】②quadprog求解正定、半正定、负定二次规划
- Fried money, lost 10million.
- [dark horse morning post] Yu Minhong said he never looked at the stock price of New Oriental; Hengchi 5 will start pre-sale in July; Naixue virtual stock or suspected of illegal fund-raising; From Jul
- Continue to advance, and softcom power steadily promotes cloud intelligence strategy
- Daily mathematics serial 55: February 24
- Button button clear border
- Po mode deep encapsulation
猜你喜欢

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

Initial experience of Flink, a mainstream real-time stream processing computing framework

Apple amplification! It's done so well

In the new database era, don't just learn Oracle and MySQL

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

12. Gateway new generation gateway

机器学习之线性回归详解
![[matytype] insert MathType inter line and intra line formulas in CSDN blog](/img/ff/871a3f06f898ed107a2a974d2c7bc4.png)
[matytype] insert MathType inter line and intra line formulas in CSDN blog

Wireshark TS | 快速重传和乱序之混淆

数字藏品市场新局面
随机推荐
数据库的增删改查问题
Design and practice of new generation cloud native database
大佬们 有没有搞过sink分流写入clickhouse 或者其他数据库的操作。
新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
leetcode:111. 二叉树的最小深度
有大佬知道这是为啥吗?表结构都是刚直接复制的源表 mysql-cdc
442. 数组中重复的数据
MySQL interception_ MySQL method for intercepting strings [easy to understand]
Continue to advance, and softcom power steadily promotes cloud intelligence strategy
The programmer was beaten.
12款大家都在用的产品管理平台
项目必用的全局异常处理器,你学会了吗
Matplotlib数据可视化基础
[MPC] ② quadprog solves positive definite, semi positive definite and negative definite quadratic programming
Hardware midrange project
sql语句修改字段类型「建议收藏」
The stock position building rate of global funds and asset management reached a new low in 15 years
关于#数据库#的问题:GBase 8s中如何避免死锁
php 实现抽奖功能
In the new database era, don't just learn Oracle and MySQL