how to get data from two table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amit Rai
    New Member
    • Aug 2010
    • 5

    #1

    how to get data from two table

    let us suppose there are two tables namely 'employee' and 'department'. In employee table columns are emp_id PK and emp_name.In department table columns are dep_id as FK(emp_id),sala ry,month; here one id contain multiple months salary.
    Now,
    we have to find out the name,salary of the TOP 3 employee whose salary is maximum in his all months salary.
  • Jerry Winston
    Recognized Expert New Member
    • Jun 2008
    • 145

    #2
    How does one dept_id row have multiple months pay? Does your dept table look like this:

    Code:
    dept_id,   emp_id,   salary,   month1,  month2,   month3,  month4,  ...

    Can you give us a sample data set?

    Comment

    • MrMancunian
      Recognized Expert Contributor
      • Jul 2008
      • 569

      #3
      I'm pretty sure this is a school assignment. Please read our Guidelines on posting Homework or Coursework questions.

      Steven

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        Good spot Steven. It is indeed I'm sure. I've closed the thread to further posting.

        Comment

        Working...