我的查询如下,我收到错误
无效的关系运算符
on line4。
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)
答案 0 :(得分:3)
您的where clause
列中没有为dw_date_key
列指定任何条件。
我假设您要选择那些计数大于1的serial
。如果是这样,只有一个查询就足够了。
select serial
from base.base_voucher_used a
where DW_DATE_KEY = 1 --add your condition here
group by serial
having count(*) > 1