SQL Server 2012 Results Grid

Is it possible to do basic calculations on the results grid, such as column totals?

This will make it easier to compare results when editing queries.

+3


source to share


2 answers


I am assuming by the results grid, you mean what you get when you do a select query like "SELECT * FROM TABLE" in SQL Management Studio. If so, then no, you cannot.

The best you can do is use one of the aggregate functions on the columns (s) you want to execute, for example "SELECT SUM (ColumnName) FROM TABLE" will give you the sum of the values ​​in that column.



List of SQL aggregate functions: https://technet.microsoft.com/en-us/library/ms173454(v=sql.110).aspx

+1


source


No , you cannot do the result as you can in Excel. The results are displayed in the grid, if you want to get the invoice or amount, then you have to write a query to do this using functions like COUNT()

and SUM()

.



+1


source







All Articles