MySQL Forums
Forum List  »  Newbie

Re: finding a 'streak'
Posted by: Felix Geerinckx
Date: August 02, 2005 03:45AM

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.

Options: ReplyQuote


Subject
Written By
Posted
August 01, 2005 09:36AM
August 01, 2005 09:46AM
August 01, 2005 11:01AM
August 01, 2005 12:46PM
August 01, 2005 03:09PM
August 01, 2005 03:36PM
August 01, 2005 03:34PM
Re: finding a 'streak'
August 02, 2005 03:45AM
August 02, 2005 06:57AM
August 02, 2005 09:35AM
August 02, 2005 11:15AM
August 02, 2005 12:07PM
August 02, 2005 04:44PM
August 02, 2005 11:18AM
August 02, 2005 11:22AM
August 02, 2005 08:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.