Implements full player get

This commit is contained in:
2024-10-28 00:05:30 +01:00
parent 7903bb7830
commit c8d5540b0d
7 changed files with 178 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
-- 3. Get all associations (N rows)
with
AllAssociations as (
select
lhs as PlayerID,
rhs as AssociateID,
note
from
association
where
lhs = $1
union
select
rhs as PlayerID,
lhs as AssociateID,
note
from
association
where
rhs = $1
)
select
p.id as AssociateID,
p.name as AssociateName,
coalesce(a.note, '') as AssociationNote
from
AllAssociations a
join player p on a.AssociateID = p.id;