Hi all,
My table have just few fields. I need to compare price in current week to prior week, determine PRICE DROP and put flag for this record.
WK_END SKU PRICE
-------------------------------------
07/18/03 5565317330 1.29
07/25/03 5565317330 1.29
08/01/03 5565317330 1.29
08/08/03 5565317330 1.29
08/15/03 5565317330 1.29
08/22/03 5565317330 0.99
08/29/03 5565317330 0.99
My new table should look like that:
WK_END SKU PRICE PRICE_DROP_FLG
-------------------------------------------------------
07/18/03 5565317330 1.29
07/25/03 5565317330 1.29
08/01/03 5565317330 1.29
08/08/03 5565317330 1.29
08/15/03 5565317330 1.29
08/22/03 5565317330 0.99 DROP
08/29/03 5565317330 0.99
How this can be accomplished in transact-SQL?
Thank you.
My table have just few fields. I need to compare price in current week to prior week, determine PRICE DROP and put flag for this record.
WK_END SKU PRICE
-------------------------------------
07/18/03 5565317330 1.29
07/25/03 5565317330 1.29
08/01/03 5565317330 1.29
08/08/03 5565317330 1.29
08/15/03 5565317330 1.29
08/22/03 5565317330 0.99
08/29/03 5565317330 0.99
My new table should look like that:
WK_END SKU PRICE PRICE_DROP_FLG
-------------------------------------------------------
07/18/03 5565317330 1.29
07/25/03 5565317330 1.29
08/01/03 5565317330 1.29
08/08/03 5565317330 1.29
08/15/03 5565317330 1.29
08/22/03 5565317330 0.99 DROP
08/29/03 5565317330 0.99
How this can be accomplished in transact-SQL?
Thank you.