Left join guilds to show players without guilds
This commit is contained in:
@@ -6,6 +6,6 @@ select
|
||||
g.name as GuildName
|
||||
from
|
||||
player p
|
||||
join guild g on p.guild = g.id
|
||||
left join guild g on p.guild = g.id
|
||||
where
|
||||
p.name = $1;
|
@@ -2,7 +2,7 @@ select
|
||||
p.id,
|
||||
p.name,
|
||||
p.guild,
|
||||
g.name,
|
||||
coalesce(g.name, 'N/A'),
|
||||
count(distinct n.player) as nnotes,
|
||||
count(
|
||||
distinct case
|
||||
@@ -15,6 +15,6 @@ from
|
||||
left join note n on n.player = p.id
|
||||
left join association a on a.lhs = p.id
|
||||
or a.rhs = p.id
|
||||
join guild g on p.guild = g.id
|
||||
left join guild g on p.guild = g.id
|
||||
group by
|
||||
p.id
|
Reference in New Issue
Block a user