• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

SQL Query

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can anyone provide me with an sql query using which I could find out the first employee details who has the second highest salary in Emp table.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Diwakar,
Yes, I can supply you with the SQL query you require (assuming it is for an Oracle database), but it seems that this is a homework assignment. If so, then perhaps you would care to explain to me why I (or someone else) should do your homework for you.

Good Luck,
Avi.
 
author & internet detective
Posts: 42152
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Diwakar,
If you haven't seen Mark's note yet, please update your last name do more than an initial.

Regardless of whether this is a homework assignment, the key is to start building the query in little pieces.

Do you know how to write a SQL query to find out the highest salary? The second highest salary? The employee with a specific salary? Post some of these and then we can work with you to merge them into the query you need. Or you may find that the query writes itself at that point. Or if you get stuck on one of these, we can point you in the right direction.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic