SUM() function in SQL Server

SQL Functions SQL Server
Sum():- This function is used to get the sum of values of the specified numeric column.


 Select Sum (column_name) from tablename


In this article, we are going to use the following table for the examples:-

CREATE TABLE [dbo]. [Employee](
[Empid] [Int] IDENTITY (1, 1) NOT NULL Primary key,
[EmpNumber] [nvarchar](50) NOT NULL,
[EmpFirstName] [nvarchar](150) NOT NULL,
[EmpLAStName] [nvarchar](150) NULL,
[EmpEmail] [nvarchar](150) NULL,
[Salary] [int] NULL

We insert following data into the above tables:-
Insert Into Employee (EmpNumber,EmpFirstName,EmpLAStName,EmpEmail,salary)

Insert Into Employee (EmpNumber,EmpFirstName,EmpLAStName,EmpEmail,salary)

Insert Into Employee (EmpNumber,EmpFirstName,EmpLAStName,EmpEmail,salary)

Insert Into Employee (EmpNumber,EmpFirstName,EmpLAStName,EmpEmail,salary)

Insert Into Employee (EmpNumber,EmpFirstName,EmpLAStName,EmpEmail,salary)
Values(‘A005′,’Avinash’, ‘Dubey’,’’,250000) 

For example, query for finding the total amount of salary given by the company to its employee is given below:-

 Select sum (salary) from Employee



31 thoughts on “SUM() function in SQL Server

  1. Pingback: w88 club
  2. Pingback: w88
  3. Pingback: low doc home loans
  4. Pingback: cryptocurrencies
  5. Pingback: jaguarqq
  6. Pingback: w888
  7. Pingback: didi promo code
  8. Pingback: w88th
  9. Pingback: Darknet Drogen
  10. Pingback: Samsara Market
  11. Pingback: Samsara Market
  12. Pingback: Slager hengelo
  13. Pingback: Sea Games 2019
  14. Pingback: megapoker99
  15. Pingback: w88 casino online
  16. Pingback:
  17. Pingback: Leif
  18. Pingback: poker 99
  19. Pingback: tilecacuoc
  20. Pingback: data sgp
  21. Pingback: fowling rules

Leave a Reply