Given a table for records of ad fill_rates, return the records that has > 10% decrease fill_rate compared to the previous day. fill_rates table: date ad fill_rate ------------------------------------ 01-01 A 20 01-02 A 10 01-01 B 40 01-02 B 5 ...
Sigiloso
SELECT * FROM fill_rates WHERE fill_rate - LAG(PARTITION BY ad ORDER BY date) > 10