DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Solve a problem

  1. #1
    Join Date
    Jul 2008
    Location
    Chittagong, Bangladesh
    Posts
    12

    Question Solve a problem

    Dear experts,
    greeting for trying to solve this problem. From employees table. I want to find those peoples(last_name) and salary who got the 3rd and 4rth higest salary in the department.

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    what have you come up with so far then

  3. #3
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Here is what I came up with. Its probably not the most elegant code,
    but here it is anyway.

    Code:
    select file_id, file_name, tablespace_name 
      from ( select rownum rank, file_id, 
                    file_name, tablespace_name 
               from ( select file_id, file_name, tablespace_name 
                        from dba_data_files 
                       order by 1 desc ) 
              order by FILE_ID asc ) 
     where rank in (3,4) 
     order by file_id;
    Analytics would yield a cleaner solution though.

  4. #4
    Join Date
    Jul 2008
    Location
    Chittagong, Bangladesh
    Posts
    12
    Thanks lot, gandolf989 for trying to solve this problem. We should share our knowledge globally.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width