MySQL Forums
Forum List  »  PHP

Re: max row from table
Posted by: Rick James
Date: January 12, 2011 08:28PM

We're slipping. 28 hours, and no one has answered this trivial question.

SELECT  id,
        punch_in as max_punch_in  -- no MAX()
    FROM  employees_punches_dev
    WHERE  employees_id = '438'
      AND  deleted = 0
    ORDER BY punch_in DESC  -- Sort the rows, largest punch_in first
    LIMIT 1;                -- Grab the first

Options: ReplyQuote


Subject
Written By
Posted
January 11, 2011 02:42PM
Re: max row from table
January 12, 2011 08:28PM
January 13, 2011 08:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.