Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Stocktaking Table
- StoreID Date ProductCode Qty
- 1 2016-07-30 11 58
- 1 2016-09-30 11 97
- 2 2016-08-30 12 15
- 2 2016-09-22 55 10
- 3 2016-09-05 55 10
- Sale Table
- StoreID Date ProductCode Qty
- 1 2016-08-30 11 40
- 2 2016-08-30 12 3
- 2 2016-08-30 55 4
- 3 2016-08-30 55 6
- Desired Output
- StoreID Date Productcode Qty
- 1 2016-08-30 11 18
- 2 2016-08-30 12 12
- 2 2016-08-30 55 6
- 3 2016-08-30 55 4
- @ date1 and @date2 @storeid
- StoreID Date Productcode Qty
- 1 2016-08-30 11 18
- 2 2016-08-30 12 12
- 2 2016-08-30 55 -4
- 3 2016-08-30 55 -6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement