Prepare for your Next Interview
This is a discussion on Give example of mixmize and minimum salary find. within the SQL Server forums, part of the Databases category; Hello friends, Can any one give me the sql query which find the min and max salary find in the table. also tell me that how to find any 2nd ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hello friends,
Can any one give me the sql query which find the min and max salary find in the table. also tell me that how to find any 2nd and 3rd greatest salary in the given table. |
| Sponsored Links |
|
|||
|
Re: Give example of mixmize and minimum salary find.
Replace "n" with the no. u want to get the nth highest salary.
select * from emp e1 where ( n = ( select count ( distinct ( e2.sal ) ) from emp e2 where e2.sal >=e1.sal)) |
| The Following User Says Thank You to ssuvi For This Useful Post: | ||
|
|||
|
Re: Give example of mixmize and minimum salary find.
You may get the result using the following query also
select level, max('col_name') from my_table where level = '&n' connect by prior ('col_name') > 'col_name') group by level; |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Find minimum number of test cases for particular case | pradeepk | Testing Issues | 5 | 02-04-2008 02:37 AM |
| Minimum requirement for creating matrix report | Geek_Guest | Oracle | 2 | 07-30-2007 09:07 AM |
| employee name and salary from employee and salary table | Himu | SQL | 1 | 07-04-2007 05:34 AM |
| Can you find the letter…Give a Try | blenda | Brainteasers | 1 | 08-29-2006 03:49 AM |
| Give all possible ways for achieving this in Minimum time | Remasri | Brainteasers | 1 | 08-25-2006 04:24 PM |