Results 1 to 3 of 3

Thread: Give example of mixmize and minimum salary find.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Contributing Member
    Join Date
    Sep 2007
    Answers
    44

    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))


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact