Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2012 Results Grid

Tags:

sql

sql-server

Is it possible to perform basic calculations on a results grid, such as column totals?

This would make it much easier to compare results when editing queries.

like image 847
OWSam Avatar asked Jul 30 '26 14:07

OWSam


1 Answers

I'm assuming by results grid, you mean what you get when you do a select query such as 'SELECT * FROM TABLE' in SQL management studio. If this is the case, then no, you can't.

Best thing you can do is, use one of the aggregate functions on the column(s) you want to do the calculation on such as '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

like image 69
AzNjoE Avatar answered Aug 02 '26 04:08

AzNjoE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!