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

推荐订阅源

Project Zero
Project Zero
月光博客
月光博客
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
O
OpenAI News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Know Your Adversary
Know Your Adversary
Last Week in AI
Last Week in AI
S
Securelist
Engineering at Meta
Engineering at Meta
博客园 - 司徒正美
P
Privacy & Cybersecurity Law Blog
T
Tailwind CSS Blog
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hugging Face - Blog
Hugging Face - Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
Lohrmann on Cybersecurity
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
I
InfoQ
S
Security @ Cisco Blogs
Webroot Blog
Webroot Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
人人都是产品经理
人人都是产品经理
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 真的很菜

用户中心 - 博客园 求助:DataGrid加行号的问题 C++Builder 2007 一个JS的问题,请帮下忙! 对谷歌输入发的一点疑虑 开始练习VS2003了 VC++.NET编译的问题 SQL查询结果的合并问题 Visual studio 2005 sdk 安装引起的后果 几个微软的好东西! Visual studio 已安装模版错误怎么解决? 想学ASP建站,有几个问题,请帮忙解决,谢谢! Win2003 IIS配置asp的问题 不要轻易删除/windows/install下文件 xp下安装sqlserver2000提示有挂起 Daemon Tools手工完全卸载方案 [转]将visual studio 2005 SP1补丁整合到安装文件 转:FTP命令全集(收藏) TurboTweaks-解除Turbo Explorer限制
SQL 查询,请帮忙
真的很菜 · 2007-03-11 · via 博客园 - 真的很菜

csdn老系统错误,虽然cnblogs不关心T-SQL,但我想这里一定有人懂

两个表

Table: Ships

name yearLaunched country numGuns gunSize displacement
Bismarck 1940 Germany 8 15 42000
Oktyabrskaya Revolutsia 1914 USSR 12 12 23000
Warspite 1915 Great Britain 8 15 31000
Hood 1920 Great Britain 8 15 41000
Nelson 1927 Great Britain 9 16 34000
Prince of Wales 1941 Great Britain 10 14 38000
Giulio Cesare 1914 Italy 10 13 24000
Texas 1914 USA 10 14 27000
Arizona 1916 USA 12 14 33000
California 1921 USA 12 14 32000
West Virginia 1923 USA 8 16 32000
New Jersey 1943 USA 9 16 46000
Missouri 1944 USA 9 16 46000
Kirishima 1915 Japan 8 14 32000
Fuso 1915 Japan 12 14 35000
Yamashiro 1917 Japan 12 14 35000
Nagato 1920 Japan 8 16 38000
Yamato 1941 Japan 9 18 65000
Musashi 1942 Japan 9 18 65000

Table: Battles

ship battleName result
Fuso Surigao Strait sunk
Yamashiro Surigao Strait sunk
California Surigao Strait ok
West Virginia Surigao Strait ok
Bismarck North Atlantic sunk
Hood North Atlantic sunk
Prince of Wales North Atlantic damaged

其中ships.name=battles,ship
我用
select distinct ships.country ,Battles.battleName,ships.country from ships  right join Battles on ships.name=Battles.ship
查出下面结果

country battleName country
Japan Surigao Strait Japan
USA Surigao Strait USA
Germany North Atlantic Germany
Great Britain North Atlantic Great Britain

正确答案是

country country
Japan USA
Germany Great Britain

请问怎么查?(就是查具有同一battleName的country)

还有
我用
select country,count(*)as numsunk
from ships join Battles on ships.name=Battles.ship
where battleName='Surigao Strait'
and result='sunk'
group by country

查出

但正确答案是

country numSunk
Japan 2
USA 0

我的把USA搞没了
怎么解决谢谢

虽然不干.NET事,请不要怪,百度了N天没结果