#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    1
    Rep Power
    0

    Select Field value from last record issue


    Alright, I am trying to select the value held in a field named IP_Addr from the last record in the database. How do I select the value from the IP_Addr field from the last record in the database?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,273
    Rep Power
    968
    Do you know the primary key ID for that record? If so, just select for that key. If not you can do something like this:

    select ip_addr
    from myTable
    where id = (select max(id) from myTable)

IMN logo majestic logo threadwatch logo seochat tools logo