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