How to can I get values from two rows into one? Like I have the following raw data
is this even possible with MS SQL?
these are excel sheets but I have the real data on the SQL Server
Explanation: For each product_group_id I want to have the changes of discount_id and the discount_id should have the from_discount_id and to_discount_id ,
for each product_group_id there is a min row of two and for the last entry of product_group_id there should be no entry in the new table as now changes occur.