1. SELECT SUM(sal) as “Gross Salary” from EMPLOYEES;
2. SELECT MAX(sal) as “Highest Salary” from EMPLOYEES;
ouput should be in table format
Answer Posted / sandeep modapathi
select sum(Gross_Salary),sum(Highest_Salary) from (
SELECT SUM(Salary) as Gross_Salary,0 as Highest_Salary from
EmpSalaryDetails
UNION
SELECT 0,MAX(Salary) from dbo.EmpSalaryDetails
) as rowset
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Explain in brief about Microsoft SQL server?
What are the types of user defined functions in sql server?
what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration
Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?
What is blocking and how would you troubleshoot it? : sql server database administration
Determine how to use the inserted and deleted pseudo tables?
What are the steps to process a single select statement?
what are defaults? Is there a column to which a default can't be bound? : Sql server database administration
What is the difference between inner join and equi join?
You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?
Explain difference between cross join and full outer join?
Can we call future method from trigger?
What is identity?
How to delete a database in ms sql server?
What are the two modes of authentication in sql server?