Implements full player get
This commit is contained in:
28
backend/selectAssociation.sql
Normal file
28
backend/selectAssociation.sql
Normal 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;
|
Reference in New Issue
Block a user