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

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - 许晓光

四舍五入 - 许晓光 - 博客园 ASP.NET 2.0 - 控件系列(四) – GridView绑定 - 许晓光 ASP.NET Video Streaming 在线视频播放 - 许晓光 C#调用dos命令 ASP.NET MVC 学习心得 (6) –jQuery取得控件值 - 许晓光 ASP.NET MVC 学习心得 (5) –AJAX - 许晓光 ASP.NET MVC 学习心得 (4) – 视图控制器 ASP.NET 事件冒泡技术 ASP.NET MVC 学习心得 (3) – 怎样使用服务器控件 ASP.NET MVC 学习心得 (2) - 怎样创建自定义URL Routing ASP.NET MVC 学习心得 (1) - 怎样创建简单程序 一个非常简单的C#面试题 C# Object Initialization SQL Server 性能优化(4) – Performance – Indexed Views SQL Server 性能优化(3) – Performance - DataTypes SQL – Sub Query SQL - TOP ASP.NET – Master Page 和Content Page事件执行顺序 ASP.NET 中使用Windows Live ID 验证登录
SQL – Select查询的多种方法
许晓光 · 2009-04-29 · via 博客园 - 许晓光

    CREATE TABLE tbl_students

    (

        snumber char,

        sname varchar(10)

    )

    CREATE TABLE tbl_curriculums

    (

        cnumber char,

        cname varchar(15),

        cteacher varchar(10)

    )

    CREATE TABLE tbl_relationships

    (

        snumber char,

        cnumber char,

        score varchar(3)

    )

    --Method 1 Good

SELECT S.sname

FROM

    tbl_students S,

    tbl_curriculums C,

    tbl_relationships R

WHERE

    S.snumber = R.snumber AND

    R.cnumber = C.cnumber AND

    C.cteacher = 'XU'

--Method 2 Better

SELECT S.sname

FROM

tbl_students S

WHERE

S.snumber in

(

    SELECT R.snumber

    From

        tbl_curriculums C,

        tbl_relationships R

    WHERE

        R.cnumber = C.cnumber AND

        C.cteacher = 'XU'

)

-- Method 3 Best

SELECT S.sname

FROM

tbl_students S

INNER JOIN tbl_relationships R ON S.snumber = R.snumber

INNER JOIN tbl_curriculums C ON R.cnumber = C.cnumber

AND C.cteacher ='XU'