中级农民
- 积分
- 103
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2019-3-8
- 最后登录
- 1970-1-1
|
select *
from.1point3acres
(select team,max(co) as cnt
from
(
select team,gap,count(*) co
from
(
select team,rank-ROW_NUMBER() OVER (Partition By team Order By rank) as gap
from
(
select distinct a.match_id, a.team, a.winner_flat,a.rank
from (
select *, ROW_NUMBER() over (partition by team order by match_id) as rank. ----
from world_cup1
) a,
(
select *, ROW_NUMBER() over (partition by team order by match_id) as rank-baidu 1point3acres
from world_cup1. 1point3acres
) b. From 1point 3acres bbs
where (a.rank + 1 =b.rank or a.rank - 1 = b.rank) .1point3acres
and a.winner_flat = 'Y' and b.winner_flat = 'Y'
and a.team = b.team .
) p1
)p2
group by team,gap. 1point 3 acres
) a
group by team
) t1
union
(
select team, count(winner_flat) as cnt
from world_cup1
where winner_flat = 'Y'
group by team
having count(winner_flat) = 1
). Waral dи,
union
(
select team, count(distinct winner_flat) as cnt
from. 1point 3acres
(
select c.team, c.winner_flat
from (
select *, ROW_NUMBER() over (partition by team order by match_id) as rank
. 1point 3acres from world_cup1
) c,
(
select *, ROW_NUMBER() over (partition by team order by match_id) as rank
from world_cup1. Χ
) d
where ((c.rank + 1 = d.rank) or (c.rank - 1 = d.rank))
and ((c.winner_flat = 'Y' and d.winner_flat = 'N') or (d.winner_flat = 'Y' and c.winner_flat = 'N'))
and c.team = d.team. 1point 3 acres
and c.team not in (select team from (select team,count(winner_flat) as cnt
from
(-baidu 1point3acres
select distinct a.match_id, a.team, a.winner_flat
from (
select *, ROW_NUMBER() over (partition by team order by match_id) as rank
from world_cup1
) a,
(.1point3acres
select *, ROW_NUMBER() over (partition by team order by match_id) as rank
from world_cup1
) b
where (a.rank + 1 =b.rank or a.rank - 1 = b.rank)
and a.winner_flat = 'Y' and b.winner_flat = 'Y'
and a.team = b.team . 1point 3 acres
) a
group by team
) tem
)
) t2
where winner_flat = 'Y'. check 1point3acres for more.
group by team)
|
|