Results 1 to 3 of 3

Thread: Query query

  1. #1
    Join Date
    Feb 2003

    Unanswered: Query query

    Hi there,

    How do I query a table of Dates, so that only the row with the most recent date is returned?

    Using SORT is not an option.


  2. #2
    Join Date
    Mar 2003
    Dortmund, Germany
    I see no other way than that. Or you add an auto-increment column and select the highest entry.. ?

    What's wrong with sorting by date and using limit 1 ?

  3. #3
    Join Date
    Feb 2003
    It's actually part of a JOIN that I'm trying to create.

    I want to join 2 tables where the row with the most recent date from Table_A is joined to row(s) from Table_B.

    I cannot use SORT or LIMIT on Table_A because that would mean I would be trying to use a subquery as one of the JOIN parameters, which you cannot do in mySQL.

    I'm trying to avoid a 2 step query if possible (also trying to flex my brain a bit!) My last resort at the moment is to use a temporary table.

    I'm curious to know if there is a method of doing it in 1 step though.


    (I might be wrong in everything I've said above!)

Posting Permissions

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