Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    50

    Arrow Unanswered: distinct of Col1 with the corresponding max(COl2)

    Hi,
    How can I achieve the following result.

    Col1 Col2
    ---- -------
    1 1
    1 2
    2 1
    2 5
    2 2
    3 2
    3 4


    Result:
    Col1 Col2
    ---- ------
    1 2
    2 5
    3 4

    I want to get distinct of Col1 with the corresponding max(COl2)

    Thanks,
    Ishan.

  2. #2
    Join Date
    Mar 2004
    Location
    Berkshire, UK
    Posts
    186
    SELECT col1, MAX(col2) FROM tab1
    GROUP BY col1
    ORDER BY 1,2
    There are 10 types of people in the world, those that know Binary and those that don't.

Posting Permissions

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