Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Athens,GR
    Posts
    16

    Unanswered: Find Last Status

    I HAVE A TABLE LIKE THIS

    ID CUSTOMERID NAME
    -------------------------------------
    1 12345 JOHN
    2 12345 JOHN
    3 56789 ANGELO
    4 56789 ANGELO
    5 56789 ANGELO
    6 56789 ANGELO
    7 87654 TIM
    8 87654 TIM
    9 87654 TIM

    I WANT EACH TIME TO HAVE THE LAST VALUE FOR EACH CUSTOMER,FOR EXAMPLE HERE I WANT TO HAVE LINES 2,6,9
    I DONT KNOW HOW TO USE KOIN VERY GOOD NEITHER THE MAX STATEMENT
    THANK YOU

  2. #2
    Join Date
    Feb 2004
    Location
    Vienna/Austria
    Posts
    7
    assuming your tablename is 'customer':

    SELECT MAX(id) AS maxid, name FROM customer
    GROUP BY name ORDER BY maxid

    Willi

  3. #3
    Join Date
    Dec 2003
    Location
    Athens,GR
    Posts
    16
    Originally posted by willi.st
    assuming your tablename is 'customer':

    SELECT MAX(id) AS maxid, name FROM customer
    GROUP BY name ORDER BY maxid

    Willi
    Dear Willy,

    thank you for your reply.
    my table looks like:
    ID CUSTOMERID NAME
    -------------------------------------
    1 12345 JOHN
    2 12345 JOHN
    3 56789 ANGELO
    4 56789 ANGELO
    5 56789 ANGELO
    6 56789 ANGELO
    7 87654 TIM
    8 87654 TIM
    9 87654 TIM

    the outcome i'd desire is like this:

    2 12345 JOHN
    6 56789 ANGELO
    9 87654 TIM


    thank you

Posting Permissions

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