SQL基础之SQL实例练习及其问题解答

来源:IT168技术  发布日期:2011-12-02 09:20:31

  例题1:

  SQL基础练习:SQL实例练习精确解答

  本人自己的解法:

select distinct Name,
(
case Name
when N'拜仁' then (select count(*) from TableScore where Score='' and Name='拜仁')
when N'湖人' then (select count(*) from TableScore where Score='' and Name='湖人')
when N'奇才' then (select count(*) from TableScore where Score='' and Name='奇才')
end
) as 胜,
(
case Name
when N'拜仁' then (select count(*) from TableScore where Score='' and Name='拜仁')
when N'湖人' then (select count(*) from TableScore where Score='' and Name='湖人')
when N'奇才' then (select count(*) from TableScore where Score='' and Name='奇才')
end
) as
from TableScore
 

延伸阅读:

Tag标签: SQL基础   SQL实例  
  • 专题推荐

About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规