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

I want a select statement to return two values, sum of one column and customer number

$
0
0

I have two columns one called invoice_number and the other invoice_amount. I want a select statement to return two columns.... invoice_number and then the sum of the invoice_amount(s) for each unique invoice number.

SELECT sum(invoice_amount) AS Totalinvoice_amount FROM InvoiceTB where invoice_number = 'INV102'

This is where I've started, which returns:
Totalinvoice_amount
500.00

Any help is appreciated.


Please mark my post as helpful or the answer or better yet.... both! :) Thanks!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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