2014-01-18 66 views
-1

我的查詢如下,我得到一個錯誤,我得到ORA-00920:無效的關係運算符

無效的關係運算符

在4號線。

select SERIAL 
    from base.base_voucher_used b 
where b.dw_date_key 
    and serial in (select serial 
        from base.base_voucher_used a 
        where DW_DATE_KEY 
        group by serial 
        having count(*) > 1) 

回答

3

您還沒有指定任何條件,以你的where clause爲列dw_date_key

我假設你想選擇那些serial,其中計數大於1.如果是這樣,只有一個查詢就足夠了。

select serial 
    from base.base_voucher_used a 
where DW_DATE_KEY = 1 --add your condition here 
group by serial 
having count(*) > 1