Tuesday, November 10, 2015

SUM Function (SQL)

Today I was asked to pull some data and give a total of a specific column in a table in SQL.  I then realized that not everyone would have came across this.  

With that said, I thought I would type up this little blog to explain and show it to you.

Use the SUM() Function to get the total of a specific numeric column.  Below is the specific syntax to use.

SQL SUM Example:

SELECT  SUM(ColumnName) 
FROM TableName;

Please note, you can also preform formulas and groupings while using this function as well.  I will show you those at a later date.

If you like this post and want to see more, follow me on my website www.chadcompton.com
Or if you prefer...

No comments:

Post a Comment

Drop me a line.