1
|
SELECT *
|
2
|
FROM "plotMetadata"
|
3
|
LEFT JOIN
|
4
|
(
|
5
|
SELECT
|
6
|
"*party_code" AS "PrimOwnerID"
|
7
|
, event_participant_name AS "PrimOwnerID_name"
|
8
|
FROM party_code_party_
|
9
|
) AS "PrimOwnerID" USING ("PrimOwnerID")
|
10
|
LEFT JOIN
|
11
|
(
|
12
|
SELECT
|
13
|
"*party_code" AS plot_administrator
|
14
|
, event_participant_name AS plot_administrator_name
|
15
|
FROM party_code_party_
|
16
|
) AS plot_administrator USING (plot_administrator)
|
17
|
LEFT JOIN "lookup_MethodCode" USING ("MethodCode")
|
18
|
;
|
19
|
|
20
|
ALTER TABLE :table ADD PRIMARY KEY ("PlotID");
|