If you aren't ordering the data, then there is no such thing as the "next row", at least to a relational database. If I do
Code:
SELECT *
FROM someTable
a database is free to return the rows in whatever order it desires. The order may change over time. If you are not specifying an order, the database can order your rows arbitrarily. I assume you want a particular "next value" for each row, not an arbitrary value...
Also, what database are you using?
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC