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

How to add a calculated field to a SQL view?

$
0
0

Hi everyone.

I have a view that pulls company IDs along with the value of each order placed year to date, sorted by Company ID. So the result of the query gives multiple lines for each company, each line giving a sales value for that order

I need to add a column that displays the total of all the order values for each unique company ID.

How can I achieve this?


Viewing all articles
Browse latest Browse all 4871

Trending Articles



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