Re: MySQL database questions
I'm not the world's foremost SQL expert, but it sounds like you might best get started with a self-join, something on the (simplified) order of:
select a.atbatid as thisatbat, a.field1 as thisbase, etc., b.atbatid as nextatbat, b.field1 as nextbase, etc.
from atbat a
left join atbat b
on b.plateappearance = a.plateappearance + 1
where a.thisgame = b.thisgame
Might not have that exactly right but you get the idea. You would get a record with the info of both an at-bat and its following at-bat, and run your calculations against that.
Not all who wander are lost