MySQL Forums
Forum List  »  Newbie

Re: Getting data from previous row
Posted by: Rick James
Date: September 22, 2011 07:05PM

(SELECT max(invoice_dt) FROM t1 WHERE b.invoice_dt < a.invoice_dt LIMIT 1)
-->
(SELECT invoice_dt FROM t1 WHERE invoice_dt < a.invoice_dt ORDER BY invoice_dt DESC LIMIT 1)

(That is, no MAX; add ORDER BY)

Options: ReplyQuote


Subject
Written By
Posted
September 20, 2011 09:35AM
Re: Getting data from previous row
September 22, 2011 07:05PM
September 23, 2011 06:29AM


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.