当前位置:网站首页>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语句,谢谢
边栏推荐
- IPv6 learning notes
- Raspberry pie 4B system construction (ultra detailed version)
- scratch大鱼吃小鱼 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
- 【黑马早报】俞敏洪称从来不看新东方股价;恒驰5将于7月开启预售;奈雪虚拟股票或涉嫌非法集资;7月1日起冰墩墩停产...
- 吃一个女富豪的瓜。。。
- 7-Zip boycotted? The callers have committed "three crimes": pseudo open source, unsafe, and the author is from Russia!
- Network partition notes
- Postgraduate entrance examination vocabulary 2023 sharing (1)
- MySQL common commands
- Ubuntu system installation and MySQL configuration
猜你喜欢

渗透常用工具-Goby

好高的佣金,《新程序员》合伙人计划来袭,人人皆可参与!

The stock position building rate of global funds and asset management reached a new low in 15 years

架构实战营 模块九:设计电商秒杀系统

C# 一行代码计算文件的MD5值 - CodePlus系列

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

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

12.Gateway新一代网关

Apple amplification! It's done so well

Who has the vision to cross the cycle?
随机推荐
零基础入行软件测试必看,10年测试老鸟的良心建议(共15条)
线程基础知识
微信表情符号写入判决书,你发的OK、炸弹都可能成为“呈堂证供”
树莓派4B系统搭建(超详细版)
【黑马早报】俞敏洪称从来不看新东方股价;恒驰5将于7月开启预售;奈雪虚拟股票或涉嫌非法集资;7月1日起冰墩墩停产...
Huawei accounts work together at multiple ends to create a better internet life
The "China Mobile Chain" state secret engine was officially launched on BSN
PHP string to binary conversion
Swag init error: cannot find type definition: response Response
遇到女司机业余开滴滴,日入500!
Fried money, lost 10million.
PHP 字符串与二进制相互转换
About widthstep of images in opencv
睡了二哥。。。
BSN长话短说之十:如何保证NFT的安全
7-Zip 遭抵制?呼吁者定下“三宗罪”:伪开源、不安全、作者来自俄罗斯!
TC8:UDP_USER_INTERFACE_01-08
Change password of MySQL version 5.7 and 8.0
日本教授起诉英特尔FPGA与SoC产品侵犯一项设计专利
Floyd repeat