您正在创建ret_code
两次具有相同列的视图; 如果您在视图中两次出现相同的列,则需要为两次出现之一使用别名:
CREATE VIEW ReturnCode90 AS SELECT t.ret_code as someAlias, TO_CHAR (t.imx_creation_dt, 'DD-MON-YYYY HH24:MI:SS') Created_Date, CURRENT_TIMESTAMP Curr_tmp, t.* FROM imxbuff.bank_imx_pmt_head t WHERE t.ret_Code = '90' order by t.imx_creation_dt desc;
如果您不想这样,可以从选择列表中删除该列
SELECT TO_CHAR (t.imx_creation_dt, 'DD-MON-YYYY HH24:MI:SS') Created_Date, CURRENT_TIMESTAMP Curr_tmp, t.*
或者,更好地,显式写入列名而不是使用*
:
SELECT t.ret_code, TO_CHAR (t.imx_creation_dt, 'DD-MON-YYYY HH24:MI:SS') Created_Date, CURRENT_TIMESTAMP Curr_tmp, t.otherColumn1, t.otherColumn2, ...