惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

雾非雾 - DESC

暂无文章

SQL 语句查询之 ORDER BY xxx DESC
花非花 · 2022-10-29 · via 雾非雾 - DESC

SQL 语句查询之 ORDER BY xxx DESC

DESC

工作需要,在一张表中一个人有多条记录;需要提取所有记录中,序号最大的条的前几列、加序号最小的一行的后二列;
常规思路,查询所有数据选第一行;

SELECT TOP 1 * FROM VCF1 WHERE VAA01=473 AND VAA07=777

第一行好办,最后一行怎么办?
第一次想到排序的规则:升序、降序;ORDER BY 如果不加参数,默认按升序排列,如果要按降序排列,加 DESC 即可

SELECT TOP 1 * FROM VCF1 WHERE VAA01=473 AND VAA07=777 ORDER BY VCF01 DESC

目前返回的结果是自己想要的,还有没有其他 BUG 后面遇到再调整