How about this
SELECT *
FROM (
SELECT
SEQ,
NAME,
ADDR,
CSZ,
VERSION,
(SELECT COUNT(*)
FROM TABLE_A AS innertable
WHERE innertable.version = outertable.version
AND innertable.seq <= outertable.seq
) AS...
You're not alone—coming from something like FoxPro, where row-by-row processing is built-in and intuitive, MySQL can feel a bit different since it's set-based rather than row-based. SQL, especially in MySQL, isn't designed to iterate through rows in the same procedural way as older desktop...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.