展开全部
select date,sum(case result when '胜' then 1 else 0) 胜,
sum(case result when '负' then 1 else 0) 负
group by date
sum(case result when '负' then 1 else 0) 负
group by date
追问
sql server2005不能运行,提示“)”处有错误~
追答
select date,sum(case result when '胜' then 1 else 0) as [胜],
sum(case result when '负' then 1 else 0) as [负]
group by date
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select DATE,
count(case when result = '胜' then result end ) '胜',
count(case when result = '负' then result end) '负'
from competition
group by date
count(case when result = '胜' then result end ) '胜',
count(case when result = '负' then result end) '负'
from competition
group by date
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select date,sum(case when result='胜' then 1 else 0 end) as 胜,sum(case when result='负' then 1 else 0 end) as 负
from Competition group by date
from Competition group by date
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select date, sum(decode(result,'胜',1,0)),sum(decode(result,'负',1,0))
from Competition group by date
from Competition group by date
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select date,sum(case result when '胜' then 1 else 0 end) 胜,
sum(case result when '负' then 1 else 0 end) 负 from Competition
group by date
sum(case result when '负' then 1 else 0 end) 负 from Competition
group by date
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询