Oracle内部联接

时间:2019-02-21 10:09:33

标签: oracle syntax

如何显示usrnm表中的user列,如果我将user.usrnm列添加到此查询中,则会出现错误

  

无效的标识符

查询:

SELECT 
    KRDFAS.NOFAS, MSTCST.CNM, MSTCST.REFERENSI, KRD100.PLF_DEBITUR,
    TBL_GROUP.NAMA_GROUP, ACOFF.NM_AO, MSTCST.KETERANGAN 
FROM 
    KRD100
INNER JOIN 
    KRDFAS ON KRD100.NOFAS = KRDFAS.NOFAS
INNER JOIN 
    MSTCST ON KRDFAS.CNO = MSTCST.CNO AND MSTCST.ALTERNATE = KRDFAS.ALTERNATE
INNER JOIN 
    TBL_GROUP ON MSTCST.KD_GROUP = TBL_GROUP.KD_GROUP 
INNER JOIN 
    PRODUK ON KRDFAS.JENIS = PRODUK.KD_PRODUK
INNER JOIN 
    ACOFF ON KRDFAS.AO = ACOFF.KODE_AO
WHERE 
    KRDFAS.KDCAB IN (SELECT KDCAB 
                     FROM TBLAREA 
                     WHERE KDAREA = :kd_area) 
    AND KRDFAS.STSKRD = 'OK' 
    AND PRODUK.KD_PRODUK LIKE :kd_produk;

1 个答案:

答案 0 :(得分:0)

Dimas,      您引用的表'User'未包含在select语句中。您引用的用户字段为user.usrnm,但语句中没有描述表'user'的表。