答案 0 :(得分:1)
使用子查询尝试以下查询:
Select date_id, product,warehouse,amount
From
(
Select
date_id, product, warehouse, amount,
lag(amount) over (partition by product, warehouse order by date_id) amount_prev
From TABLENAME
) x
Where amount <> amount_prev