Query for Getting the Top 5 Lowest Values

Asked By 20 points N/A Posted on -
qa-featured

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.

SHARE
Best Answer by Lawren chavez
Answered By 0 points N/A #100504

Query for Getting the Top 5 Lowest Values

qa-featured

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.

Best Answer
Best Answer
Answered By 0 points N/A #100506

Query for Getting the Top 5 Lowest Values

qa-featured

 

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.

Login/Register to Answer

Related Questions