使用 oracle 10 我有一个到 sql server 的链接。我有一个查询(如下)运行良好,就像一个选择语句但是当我使用它来创建一个视图时(视图创建成功但是当我尝试在 sql developer 中查看视图中的数据时)我得到一个
数据库“链接名称”在此上下文中不支持 ROWID
问题是我将一个表中的多行组合成多列的子选择吗?
SELECT
upper(cus."cus_last_name") AS lname,
upper(cus."cus_first_name") AS fname,
upper(cus."cus_initial") AS minitial,
upper(cus."maiden_name") AS olname,
pt."cus_dob" AS dob,
pt."cus_id" AS id,
(
SELECT
cus_inst_key."cus_key_value"
FROM
"cus_inst_key"@linkname cus_inst_key
WHERE
cus_inst_key."cus_id" = cus."cus_id"
AND cus_inst_key."cus_key_cd" = 1
) AS CUSALTID,
(
SELECT
pcus_inst_key."cus_key_value"
FROM
"cus_inst_key"@linkname cus_inst_key
WHERE
cus_inst_key."cus_id" = cus."cus_id"
AND cus_inst_key."cus_key_cd" = 2
) AS CUSALTID2,
(
SELECT
cus_inst_key."cus_key_value"
FROM
"cus_inst_key"@linkname cus_inst_key
WHERE
cus_inst_key."cus_id" = cus."cus_id"
AND cus_inst_key."cus_key_cd" = 3
) AS CUSALTID3,
(
SELECT
cus_inst_key."cus_key_value"
FROM
"cus_inst_key"@linkname cus_inst_key
WHERE
cus_inst_key."cus_id" = cus."cus_id"
AND cus_inst_key."cus_key_cd" = 4
) AS CUSALTID4
FROM
"cus"@linkname cus;
谢谢你的帮助。
视图实际上是创建好的,由于某种原因,我只是不能在 sql developer 中使用数据选项卡。