Results 1 to 4 of 4

Thread: max and associated value

  1. #1
    Join Date
    Jun 2012
    Posts
    2

    max and associated value

    Suppose I have a table of values and times. Is there a single sql query that will return the max value and the time that's associated with it?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Can post more detail. You can do something like

    select * from table
    where time=
    select max(time) from table

  3. #3
    Join Date
    Jun 2012
    Posts
    2
    Thanks. I was hoping that there was some magic way to do this in one select, but I should have known better.

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932

Posting Permissions

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