select
时间,
SUM
(
case
when
win=
‘胜‘
then
1
else
0
end
) 胜,
SUM
(
case
when
win=
‘负‘
then
1
else
0
end
) 负
from
tb
group
by
时间
case相当于if.....else 条件语句
标签:ase ber string 条件语句 key else 语句 keyword win
select
时间,
SUM
(
case
when
win=
‘胜‘
then
1
else
0
end
) 胜,
SUM
(
case
when
win=
‘负‘
then
1
else
0
end
) 负
from
tb
group
by
时间
case相当于if.....else 条件语句
标签:ase ber string 条件语句 key else 语句 keyword win
原文地址:https://www.cnblogs.com/wy20110919/p/8729226.html