Asked By
amscott
20 points
N/A
Posted on - 04/07/2012
Hello there techyv experts!
I need someone to help me on this matter.
In my database, Each employees have their salaries computed.
What is the query to display the top 5 employees having the lowest salary?
Thank you so much.
Query for Getting the Top 5 Lowest Values
Hi Amscott,
Use this SQL query:
USE Employee // your table name
GO
SELECT Emp_FName, Emp_MidName, Emp_LNameÂ
FROM Employee
WHERE Emp_Salary IN (
SELECT TOP 5 MIN(Emp_Salary) // select the bottom  5 employees according to salary
FROM Employee)
GO
I hope it helped.
Query for Getting the Top 5 Lowest Values
Â
Hi Amscott,
Assume that your table is Employee: Emp_FName, Emp_MName, Emp_LName, Salary
Â
This is a SQL query to display the top 5 employees having the lowest salary:
Â
SELECT TOP 5 Emp_FName, Emp_MName, Emp_LName, Salary
FROM Employee
ORDER BY Salary
Â
I hope it helpful.