表名
VF_REPORT_VAL
字段名
N_ID
D_BIZ
C_PORT_CODE
C_KEY_CODE
C_KEY_NAME
N_HLDMKV_LOCL
——创建表
create table 用户名.T_R_FR_ASTSTAT
(
ID_R_FR_ASTSTAT VARCHAR2(20) default ' ' not null,
D_ASTSTAT DATE default to_timestamp('1900-01-01','YYYY/MM/DD') not null,
C_PORT_CODE VARCHAR2(20) default ' ' not null,
C_KEY_CODE VARCHAR2(50) default ' ' not null,
C_KEY_NAME VARCHAR2(200) default ' ' not null,
N_PORT_MV NUMBER(18,4) default 0 not null,
)
——创建视图
CREATE OR REPLACE VIEW VF_REPORT_VAL AS
SELECT A.ID_R_FR_ASTSTAT AS N_ID,
A.D_ASTSTAT AS D_BIZ,
A.C_PORT_CODE AS C_PORT_CODE,
A.C_KEY_NAME AS C_KEY_NAME,
CASE WHEN A.C_KEY_CODE = 'ZCJZ' THEN A.N_PORT_MV ELSE 0 END AS N_HLDMKV_LOCL
FROM T_R_FR_ASTSTAT A