reduce rows

arkiboys 9,706 Reputation points
2022-08-16T08:04:05.093+00:00

hi,
see screen-shot below:
Question
how is it possible to achieve the result in green from the data in orange colour. -

231422-image.png

Developer technologies Transact-SQL
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.5K Reputation points
    2022-08-16T08:09:41.247+00:00

    Try something like this:

    select ID, book, dispatch, arrival, company, sum(p_value) as p_value, sum(a_value) as a_value  
    from OrangeTable  
    group by ID, book, dispatch, arrival, company  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.