sql query
-
I want to retrieve top 2 of maximum salary records.What wud be the qeury???:confused::confused::confused::confused::confused::confused::confused:
-
I want to retrieve top 2 of maximum salary records.What wud be the qeury???:confused::confused::confused::confused::confused::confused::confused:
If you've got only one table containing all salaries, your answer is as simple as this:
SELECT TOP(2) Salary
FROM TABLE
ORDER BY Salary DESC_
-
If you've got only one table containing all salaries, your answer is as simple as this:
SELECT TOP(2) Salary
FROM TABLE
ORDER BY Salary DESC_
Can u plz tell if I want to get minimum of top 2.
-
Can u plz tell if I want to get minimum of top 2.
Order the records in ascending order and select top two :)
Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion
-
I want to retrieve top 2 of maximum salary records.What wud be the qeury???:confused::confused::confused::confused::confused::confused::confused:
-
I want to retrieve top 2 of maximum salary records.What wud be the qeury???:confused::confused::confused::confused::confused::confused::confused:
-
Now I got a question for you; Imagine you want to retrieve the top 3 salary records. How would you go about and do that? :-D
you din understand my question and now making fun of me.'minimum of top 2' means the lesser of the top 2 that is the second largest salary.Now if you are too smart tell this eddyvluggen.
-
you din understand my question and now making fun of me.'minimum of top 2' means the lesser of the top 2 that is the second largest salary.Now if you are too smart tell this eddyvluggen.
joindotnet wrote:
making fun of me
I was, wasn't I?
joindotnet wrote:
What wud be the qeury???
You just wanted someone to write a query for you, and someone did. Have you actually tried writing the query? If so, why didn't you post the piece that you already wrote?
-
joindotnet wrote:
making fun of me
I was, wasn't I?
joindotnet wrote:
What wud be the qeury???
You just wanted someone to write a query for you, and someone did. Have you actually tried writing the query? If so, why didn't you post the piece that you already wrote?
I can write the queries by myself. I just wanted to know whether there is a simplification for it select min(salary) from (select top 2 salary from order by salary desc) By the way this place is for professionals not for people like u who r here to have fun.
-
I can write the queries by myself. I just wanted to know whether there is a simplification for it select min(salary) from (select top 2 salary from order by salary desc) By the way this place is for professionals not for people like u who r here to have fun.