当前位置:网站首页>SQL Server列一相同的情况下,如何取列二的最大值,并重新生成表
SQL Server列一相同的情况下,如何取列二的最大值,并重新生成表
2022-07-01 10:08:00 【CSDN问答】
我有一个数据库的格式如下:
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
第一步筛选出下面的表
SourceName TimeStamp Status
Alarm1 20220101 1
Alarm1 20220102 0
Alarm1 20220103 1
Alarm2 20220101 0
Alarm2 20220301 1
Alarm3 20220301 1
Alarm3 20220501 1
第二步,在列一相同的情况下,取出列二的最大值
期待结果
SourceName TimeStamp Status
Alarm1 20220103 1
Alarm2 20220301 1
Alarm3 20220501 1
想知道这样的筛选应该怎么写SQL语句,谢谢
边栏推荐
- 客户端如何请求数据库?
- The stock position building rate of global funds and asset management reached a new low in 15 years
- Sqlization is the first step in ETL incremental production. What are the core capabilities of such an architecture?
- Postgraduate entrance examination vocabulary 2023 sharing (1)
- scratch大鱼吃小鱼 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
- 【黑马早报】俞敏洪称从来不看新东方股价;恒驰5将于7月开启预售;奈雪虚拟股票或涉嫌非法集资;7月1日起冰墩墩停产...
- Computer USB, HDMI, DP various interfaces and speeds
- Sd-wan notes
- 关于OpenCV中图像的widthStep
- CodeBlocks 左侧项目栏消失,workspace 自动保存项目,Default workspace,打开上次的workspace,工作区(图文教程,已解决)
猜你喜欢

Continue to advance, and softcom power steadily promotes cloud intelligence strategy

Tearful eyes, it's not easy to change jobs. Three rounds of interviews, four hours of soul torture

The latest masterpiece of Alibaba, which took 182 days to produce 1015 pages of distributed full stack manual, is so delicious

我喜欢两个男人。。。

程序员都想去国企?技术落后薪资低,躺平几年出来都找不到工作...

venv: venv 的目录结构

Kotlin 协程调度切换线程是时候解开真相了

SQL SERVER2014删除数据库失败,报错偏移量0x0000...

Sleeping second brother...

Dotnet console uses microsoft Maui. Getting started with graphics and skia
随机推荐
button按钮清除边框
Meituan P4 carefully collated microservice system architecture design manual to see the world of microservice architecture
请问有没有人知道clickhouse 中 limit语句执行的逻辑,图片中,上面的SQL可以执行成功
PHP code audit and File Inclusion Vulnerability
Ubuntu系统安装与配置MySQL
Tryhackme Christmas challenge 2021 advance of cyber 3-day1-idor vulnerability, insecure access control vulnerability
C# [字节数组]与[16进制字符串]互相转换 - CodePlus系列
“中移链”国密引擎在BSN正式上线
Is the securities account opened by Yixue school for individuals safe? Is there a routine
MySQL common commands
leetcode:111. 二叉树的最小深度
Huawei accounts work together at multiple ends to create a better internet life
主流实时流处理计算框架Flink初体验
Prefabricated dishes usher in the "golden age", who can lead the next trillion market
Postgraduate entrance examination vocabulary 2023 sharing (1)
Zero foundation software testing must see, 10 years of testing old bird's conscience suggestions (a total of 15)
It is interesting to understand MMAP in this way!
TC8:UDP_USER_INTERFACE_01-08
CSDN's one-stop cloud service is open for internal testing, and new and old users are sincerely invited to grab the fresh
SQL 化是 ETL 增量生产的第一步,这样的架构的核心能力是什么?