|
How to get the 3 rd highest salary without using any SQL keyword?
(comments are locked)
|
|
The following has no SQL Keywords:
Charlie being the head of the payroll department. :-D I like your answer, it is clean and contains no sql keywords! lol
Dec 11 '09 at 07:29 AM
Håkan Winther
It also takes care of the problem with salaries paid in different currencies!
Dec 29 '09 at 07:21 PM
Peso
(comments are locked)
|
|
Get the top 1 salary that isn't in the top 2:
and in case you want the third highest value salary, rather than just the third in a sorted list
note the
(comments are locked)
|
|
Sorry, but I have to ask what you mean by key words. SELECT is a keyword. I think you'll be hard pressed to get the data without it. How about
(comments are locked)
|
|
Maybe you mean you only want to use Standard SQL without T-SQL keywords (such as TOP). For example:
To be slightly picky, Kev, Grant and Bob's solutions won't necessarily return the third highest salary. They all return the salary from the third row of the table when sorted in salary order. Unless salary is unique that could give a different answer to my query. You decide which meets your actual requirement. it's fair to be picky.... in this game if you aren't picky then you're sloppy....have added an 'alternative' query to my answer!
Oct 29 '09 at 06:26 PM
Kev Riley ♦♦
(comments are locked)
|
1 2 next page »


what does 'without any SQL keyword' mean?
With "3 rd highest salary" do you mean worldwide, company-wide, any age or gender requirements, ... ? A fact without its dimensions is just useless...