私はいくつかの質問を読んだが、PostgreSQLとの問題は解決しなかった。postgresqlカラムが合体に存在しません
複数の表からビューを作成しようとしましたが、実際に両方の列 "ContextLink"で実際にスキーマの次の部分が "列は存在しません"というエラーを返します。私は他の列と同じ問題はありませんが、この問題の解決方法については少し失われています。
Postgresは私がここに愚かな何かが欠けておりません願ってい
ERROR: The column ProjectReferenceDataLibrary_BaseUnit.ContextLink
does not exist
LINE 1218: COALESCE("ProjectReferenceDataLibrary_BaseUnit"."Con...
^
SQL state: 42703
Character: 74151
-- Create link table for class ProjectReferenceDataLibrary
CREATE TABLE "Directory"."ProjectReferenceDataLibrary_BaseUnit" (
"ContextLink" varchar NOT NULL,
"ProjectReferenceDataLibrary" uuid NOT NULL,
"BaseUnit" uuid NOT NULL
);
-- Create link table for class ProjectReferenceDataLibrary
CREATE TABLE "Directory"."ProjectReferenceDataLibrary_BaseQuantityKind" (
"ContextLink" text NOT NULL,
"ProjectReferenceDataLibrary" uuid NOT NULL,
"BaseQuantityKind" uuid NOT NULL,
"OrderKey" bigint NOT NULL
);
CREATE VIEW "Directory"."ProjectReferenceDataLibrary_View" AS
SELECT "ProjectReferenceDataLibrary"."UniqueIdentifier", "ProjectReferenceDataLibrary"."ValueTypeDictionary" AS "ValueTypeSet",
"ProjectReferenceDataLibrary"."Container",
COALESCE("ProjectReferenceDataLibrary_BaseUnit"."BaseUnit",'{}'::text[]) AS "BaseUnit",
COALESCE("ProjectReferenceDataLibrary_BaseUnit"."ContextLink",'{}'::text[]) AS "BaseUnit_ContextLink",
COALESCE("ProjectReferenceDataLibrary_BaseQuantityKind"."BaseQuantityKind",'{}'::text[]) AS "BaseQuantityKind",
COALESCE("ProjectReferenceDataLibrary_BaseQuantityKind"."ContextLink",'{}'::text[]) AS "BaseQuantityKind_ContextLink"
FROM "Directory"."ProjectReferenceDataLibrary" AS "ProjectReferenceDataLibrary"
LEFT JOIN (SELECT "ProjectReferenceDataLibrary" AS "UniqueIdentifier", array_agg("BaseUnit"::text) AS "BaseUnit", array_agg("ContextLink"::text) AS "BaseUnit_ContextLink"
FROM "Directory"."ProjectReferenceDataLibrary_BaseUnit"
JOIN "Directory"."ProjectReferenceDataLibrary" AS "ProjectReferenceDataLibrary" ON "ProjectReferenceDataLibrary" = "UniqueIdentifier"
GROUP BY "ProjectReferenceDataLibrary") AS "ProjectReferenceDataLibrary_BaseUnit" USING ("UniqueIdentifier")
LEFT JOIN (SELECT "ProjectReferenceDataLibrary" AS "UniqueIdentifier", ARRAY[array_agg("OrderKey"::text), array_agg("BaseQuantityKind"::text)] AS "BaseQuantityKind", array_agg("ContextLink"::text) AS "BaseQuantityKind_ContextLink"
FROM "Directory"."ProjectReferenceDataLibrary_BaseQuantityKind"
JOIN "Directory"."ProjectReferenceDataLibrary" AS "ProjectReferenceDataLibrary" ON "ProjectReferenceDataLibrary" = "UniqueIdentifier"
GROUP BY "ProjectReferenceDataLibrary") AS "ProjectReferenceDataLibrary_BaseQuantityKind" USING ("UniqueIdentifier");
を返します。 ご協力いただきありがとうございます。
乾杯、
どこFROM句のですか? –
申し訳ありませんが、FROMは関連性があるとは思わなかったが、投稿を編集して – icykof
にFROM句を付けないと、列が見つからない理由を追跡することはできません.... –