I have one table which has amount column and Type_of_Order column, if sales if order then positive value and Type_of_Order ='SALES O' and if I will make return of any product from shop then amount will be negative and Type_of_Order ='RETURN O',
Using Sql server 2012
Now I need this by query sr name, if Type_of_Order column has 'SALES O' then Order_P column should created , if case when if Type_of_Order column has ''RETURN O' then Order_R column should created and value should come in single line .
SR NAME | Order_P | Order_R |
---|---|---|
XYZ | 9875 | -123 |