Mohd Radzi Ibrahim <[EMAIL PROTECTED]>
wrote:
This is my 2 cents. Maybe  there's better way to do this:

select
id,
amount,
(select amount from tablename where id=t.id and sno < t.sno limit 1)
as oldAmount
from tablename t

In the subselect, you probably want "order by sno desc"

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to