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

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - IT Person

算法 《微软的秘密》读书笔记 经典思维50法 SQL Server 2008 T-SQL编程系列课程之T-SQL标准语法 ASP.NET 4风云之旅系列之ASP.NET 4对开发人员的核心运行时新特性 ASP.NET 4 风云之旅系列之ASP.NET MVC 2的新特性 ASP.NET 4 风云之旅系列之Visual Studio 2010在Web开发方面的新特性 ASP.NET开发实践系列课程之Web应用的安全攻防之网页木马 ASP.NET开发实践系列课程之ASP.NET综合调优 从架构设计到系统实施-基于Windows Server 2008的全新企业应用之Card Space身份验证 从架构设计到系统实施-基于.NET 3.0的全新企业应用之开发Vista边栏应用 从架构设计到系统实施-基于.NET 3.0的全新企业应用之开发基于MMC 3.0的管理工具 从架构设计到系统实施-基于.NET 3.0的全新企业应用之加入Silverlight支持 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于WPF的客户端 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于AJAX和IIS7的网站 - IT Person 从架构设计到系统实施-基于.NET 3.0的全新企业应用之设计基于WF的工作流 从架构设计到系统实施-基于.NET 3.0的全新企业应用之基于WCF的系统服务 - IT Person 深度剖析Workflow Foundation之Workflow Activities 深度剖析Workflow Foundation之开发流程(下)
SQL Server 2008 T-SQL编程系列课程之常用查询算法比较
IT Person · 2010-04-05 · via 博客园 - IT Person

create table table_A(id int, testCol varchar(256));
create table table_B(id int, testCol varchar(256));
insert into table_A
select 1,'A'
union all
select 2,'B';

insert into table_B
select 1,'A'
union all
select 2,'B';

1.from
2.on
3.join
4.where


select * from table_A,table_B
where table_A.id=table_B.id;

建议写法
select * from table_A inner join table_B on table_A.id=table_B.id;

select * from table_A left join table_B on table_A.id=table_B.id;

select * from table_A right join table_B on table_A.id=table_B.id;

子查询
select * from table_A where id in (select id from table_B);

每个表中都会有主键,根据ID去除列的重复数据
select * from table_B b where not exists(select * from table_B where testCol=b.testCol and id > b.id);

日期分表查询
对于年在一百万以下的数据,可以按年分,否则还得按月分