我正试图从同一模式的两个不同表创建新视图。这是我的问题,如果我遗漏了什么,请告诉我。当我检查语法时,它很好并测试它,抛出00933错误。
CREATE OR REPLACE FORCE VIEW "APDA"."countview"
(
"dealidint", "companyidint", "nametxt", "county", "street",
"state", "city", "zip", "geocodelatdec", "geocodelongdec",
"volidint", "reportdate", "vehicletotalint", "salvagetotalint"
)
AS
SELECT a."dealidint",
a."companyidint",
a."nametxt",
a."county",
a."street",
a."state",
a."city",
a."zip",
a."geocodelatdec",
a."geocodelongdec",
c."dealervolumeidint",
c."reportdate",
c."vehicletotalint",
c."salvagetotalint"
FROM "APDA"."company" a
JOIN
"APDA"."volume" c
ON c."dealidint" = a."dealidint";
我看不出原因。我注意到的唯一可疑的是那两行空白。在SQLPlus中,我不认为这些会导致这个错误,但它们会导致命令被误解。
我的建议是:-尝试其他工具。如果您在SQLDeveloper中遇到错误,请在SQLPlus中尝试。这不一定有效,但你可能会得到不同的反馈。-将其简化为一个有效的最小语句,然后一次添加一个元素,直到错误发生
您的列名"volidint"不在所选列中,我看到"dealervoluidint"select vs"volididt"。
列名"volidint"在下面的选择查询中不可用。请使用"As"进行更正。
CREATE OR REPLACE FORCE VIEW "APDA"."countview"
(
"dealidint", "companyidint", "nametxt", "county", "street",
"state", "city", "zip", "geocodelatdec", "geocodelongdec",
"volidint", "reportdate", "vehicletotalint", "salvagetotalint"
)
AS
SELECT a."dealidint",
a."companyidint",
a."nametxt",
a."county",
a."street",
a."state",
a."city",
a."zip",
a."geocodelatdec",
a."geocodelongdec",
c."dealervolumeidint" as "volidint",
c."reportdate",
c."vehicletotalint",
c."salvagetotalint"
FROM "APDA"."company" a
JOIN
"APDA"."volume" c
ON c."dealidint" = a."dealidint";
感谢您为回答我的问题所做的努力。我分享的是一个具有相同语法的精简查询。查询很好,但我实际的查询在联接上有一个额外的字符。这就像-"APDA"。"vvolume"。
在那之后,我能够创建视图。
再次感谢。