Min value with all other columns from the table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PavanOracle
    New Member
    • Apr 2014
    • 1

    Min value with all other columns from the table

    I have table like this

    ind_id loc_id date_created ip_address
    1 20 10-12-2008 170.30
    1 15 01-08-2009 175.25
    2 20 11-12-2002 145.80
    1 20 18-02-2003 160.50
    3 20 22-10-2002 145.70
    1 20 11-06-2002 130.45
    2 15 19-01-2001 170.30
    1 20 13-11-2000 180.45


    select ind_id, min(date_create d) from table group by ind_id.

    I ma getting 1 13-11-2000
    2 19-01-2001
    3 22-10-2002

    But I want records of ind_id's with minimum date_created along all other data.

    Like: 1 20 13-11-2000 180.45
    2.........
    3............
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Join the min query back to the table.

    Comment

    Working...