I have the following data:
Store Dept Amt MTD QTD YTD
127 0 1.00 913.50 2157.18 7203.18
127 0 6.00 913.50 2157.18 7203.18
127 0 7.00 913.50 2157.18 7203.18
127 2 5.00 134.00 431.00 1298.00
129 0 13.00 155.00 661.00 3343.00
355 2 3.00 706.00 231.00 798.00
355 2 2.00 706.00 231.00 798.00
My client wants the QTD, MTD & YTD to show only on the 1st line
WHERE Store and Dept are the same as the record above it
The desired results shown below:
Store Dept Amt MTD QTD YTD
127 0 1.00 913.50 2157.18 7203.18
127 0 6.00 0 0 0
127 0 7.00 0 0 0
127 2 5.00 134.00 431.00 1298.00
129 0 13.00 155.00 661.00 3343.00
355 2 3.00 706.00 231.00 798.00
355 2 2.00 0 0 0
Is there a simple sql statement that will query the top table and return the results above?