Results 1 to 3 of 3

Thread: How to do this?

  1. #1
    Join Date
    May 2004
    Posts
    13

    Unanswered: How to do this?

    I need to select the row that has the highest value for a particular field.

    For example, lets say we have an employee table, and an employee can appear more than 1 time because an employee has several job functions:

    Emp_Id 1
    Function Clerk

    Emp_Id 1
    Function Manager


    I need to select the row with the highest function, in this case manager( because m > c)

    How can i do this, lets say the table name is Employee.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT MAX(Emp_id)?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    May 2004
    Posts
    13
    Thanks

    This is the query that I got.

    SELECT EMP_ID, MAX(FUNCTION)
    GROUP BY EMP_ID

Posting Permissions

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