MySQL Forums
Forum List  »  PHP

Re: Prev and Next row
Posted by: Peter Brawley
Date: August 17, 2014 07:05PM

> I have following database (example)

That's a table, not a database.

> I need to get data from previous and next rows, not from actual one as this code do [sic] at this moment.

'Previous' and 'Next' are meaningless unless the query imposes order with an Order By or Group By clause, eg ... select ... from trad where ... order by ciid.

So decide which column(s) you wish to order by, then add that clause to your query.

Options: ReplyQuote


Subject
Written By
Posted
August 17, 2014 12:54PM
Re: Prev and Next row
August 17, 2014 07:05PM


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.