我正在使用这个查询:
UPDATE tbl_temp SET KEYVALUE =
(
WITH PRIMARKY_KEYS AS (
SELECT listagg(colvalue,'|') WITHIN GROUP (ORDER BY idcolumn) AS colvalues,idnum
FROM tmp_columns
WHERE tmp_columns.columnname IN ('ID','IDSCHEME')
GROUP BY idnum
)
SELECT colvalues FROM PRIMARKY_KEYS P
WHERE tbl_temp.id_row = P.idnum
);
但它只是卡住了
tbl_temp 有这些列:
id_row number
test_env char(3)
tablename varchar2,
rowvalue varchar2 ,
uniquekey varchar2
keyvalue varchar2
tmp_columns 有这些列:
idnum number
env varchar2
colvalue
idcolumn
columnname