Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How can i sum the columns by condition?

$
0
0

ID    Type    QTY

1      A         20

2      A         20

3      B         20

I want to some QTY group by A but I also need the ID column to identify the order of  row.

How can I sum QTY group by A and the result is sort by ID ?

Thanks you 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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