Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
group for team members and winners in sql-server
with test as ( select 'X' team,'Andy' Name, 1 Won union all select 'X','Cara',1 union all select 'X','Cara',1 union all select 'X','Eric',0 union all select 'X','Eric',0 union all select 'X','Eric',0 union all select 'X','Eric',0 union all select 'Y','Bill',0 union all select 'Y','Dave',0 union all select 'Y','Dave',1 union all select 'Y','Dave',1 ) select team, count(distinct Name) as Players, sum(won) Winners from (select distinct * from test) tst group by team
run
|
edit
|
history
|
help
0
Chris
db6
a
TRIGGERS
№3
TSql - Unroll inventory transactions and compute daily average
QLCB_BTVN_TUAN 8
SQL Server Mistique!?
mhlongothabani99@gmail.com
Grouping, aggregate function issue when joining to another table