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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Viorel 125.8K 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.