0
我想達到以下,但面對像爲了解析函數的錯誤不允許在WHERE子句爲了分析功能在where子句
select a.araccno,a.ARBDTE,
sum(aramt) over(partition by araccno,ARBDTE ORDER BY ARAMT asc) sum1
,sum(b.Bill_Stmt_Discount_Amt) over(partition by b.bill_statement_id order by b.Bill_Stmt_Discount_Amt asc) sum2
from stg.ars_etl a
left outer join tgt.bill_sta_dis b
on 'LL'||a.araccno||a.arbdte=b.bill_statement_id
where sum1<> sum2
我怎麼能在Teradata數據實現這個不準?
非常感謝!
太棒了!感謝戈登! – user3901666