If I'm reading this correctly, a self-join might work if you have a primary key defined:
select t1.a as a1 ,t1.b as b1 ,t1.c as c1 ,t2.a as d1 from thetable as t1 ,thetable as t2 where t2.primaryid = t1.primaryid+1
John
David L. Van Brunt, Ph.D. wrote:
I have a table of data...
A1 B1 C1 A2 B2 C2
And I�d like to make a query where I �lag� a value, grabbing a value from the next row of the table. Most stat packages have a lag function, but I can�t find this in MySQL. The end result would look like:
A1 B1 C1 D1 (where �D1� would equal A2 from above)
Any suggestions?
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
