Kishore Kumar Kishore Kumar - 3 months ago 7x
SQL Question

How to display employee details along with sum(sal) of all employees?

Is it possible to display employee details like the below using SQL?

Emp_id, Emp_name, Emp_Sal, Sum(Emp_Sal)

Note: Here
is total sum of all the employees.


You can get your expected result in this way:

SELECT Emp_id, Emp_name, Emp_Sal, (SELECT SUM(Emp_Sal) FROM Employee) AS TotalSalary
FROM Employee

Working DEMO