Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

I need help with MS SQL column Merging

$
0
0

GOod day all,

I need some help, how can I merge two different column if the row id is the same?

for instance

UserID UnitPrice Paid Credit Balance

1 100 -50 25

1 100 -25 75

2 75 -50 25

3 1000 -500 500

So, for the first one in my result how can I combine the two first one and have userID one shows up once but both Paid amount and credit to be on the same line?

I would want to have as result:

UserID UnitPrice Paid Credit Balance

1 100 -50 -25 25

2 75 -50 25

3 1000 -500 500



Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>