Bobby Hodges wrote:
> Hi folks. I'm trying to figure out an efficient way to find streaks of consecutive wins or
> losses.
> ...
> mySql version is 4.0.24
A solution can be found here:
http://www.sqlteam.com/item.asp?ItemID=12654
Unfortunately, it uses subqueries which you don't have.
However, if someone can come up with a non-subquery solution for
SELECT
teamname,
gamedate,
winloss,
(SELECT COUNT(*) FROM GameStats g
WHERE g.teamname = gr.teamname AND g.winloss <> gr.winloss
AND g.gamedate <= gr.gamedate) AS invar
FROM GameStats gr
I believe it can be done with temporary tables.
--
felix
Please use
BBCode to format your messages in this forum.