您DECLARE
看起来像是从另一种 SQL 方言中获取语法,因为它不是有效的 Oracle PL/SQL 语法。
如果您使用的是 PL/SQL,那么类似(假设您的查询将返回恰好一行):
DECLARE
v_your_date DATE := DATE '2020-09-22';
v_T_SYS_FROM dss.acn_ahdj_h.T_SYS_FROM%TYPE;
v_N_D_AHDJ dss.acn_ahdj_h.N_D_AHDJ%TYPE;
v_N_FUND_ID dss.acn_ahdj_h.N_FUND_ID%TYPE;
v_N_AHDJ dss.acn_ahdj_h.N_AHDJ%TYPE;
v_T_SYS_USER dss.acn_ahdj_h.T_SYS_USER%TYPE;
v_BUDAT dss.acn_ahdj_h.BUDAT%TYPE;
BEGIN
SELECT T_SYS_FROM,
N_D_AHDJ,
N_FUND_ID,
N_AHDJ,
T_SYS_USER,
BUDAT
INTO v_T_SYS_FROM,
v_N_D_AHDJ,
v_N_FUND_ID,
v_N_AHDJ,
v_T_SYS_USER,
v_BUDAT
FROM dss.acn_ahdj_h
WHERE T_SYS_FROM = v_your_date
ORDER BY T_SYS_USER;
END;
/
如果你想要一个 SQL 查询,那么:
SELECT T_SYS_FROM,
N_D_AHDJ,
N_FUND_ID,
N_AHDJ,
T_SYS_USER,
BUDAT
FROM dss.acn_ahdj_h
WHERE T_SYS_FROM = DATE '2020-09-22'
ORDER BY T_SYS_USER;