All pastes #249856 Raw Edit

Untitled

public text v1 · immutable
#249856 ·published 2006-11-16 07:16 UTC
rendered paste body
select p.id, p.W, q.L from
	(select winner as id, count(*) as W from game group by winner) p
left outer join
	(select loser as id, count(*) as L from game group by loser) q
on p.id=q.id
union
select p.id, p.W, q.L from
	(select winner as id, count(*) as W from game group by winner) p
right outer join
	(select loser as id, count(*) as L from game group by loser) q
on p.id=q.id