Query to return multiple minimum rows of each value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • somu123
    New Member
    • Aug 2013
    • 1

    #1

    Query to return multiple minimum rows of each value

    I have a table with rows in it as below
    Column1 Column2
    4 50
    4 60
    6 30
    6 90
    6 70
    7 200
    7 100

    And I would like to get the result of the query as
    Column1 Column2
    4 50
    6 30
    7 100

    Can someone help me in writing a query for the above resultset
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use an aggregate query with the MIN function. If you do not know how to do this, you should probably look into a SQL tutorial. W3schools has a good one online.

    Comment

    • DURGAPRASAD51
      New Member
      • Sep 2013
      • 2

      #3
      Code:
      select column1,min(column2) from table_name group by column1

      Comment

      Working...