December 4, 2006 at 5:17 pm
December 5, 2006 at 6:22 am
So you're already past 25 year old too Sergiy?
December 5, 2006 at 7:21 am
And I'll be long dead. |
But your rants will be on this site for posterity
Far away is close at hand in the images of elsewhere.
Anon.
December 5, 2006 at 7:40 am
Rants!, What rants?
December 6, 2006 at 1:50 am
Scott,
Just making sure you got the answer for this same problem that you posted on the Wrox forum.
This is more than ten times faster than what they posted there. I also posted this same thing there.
SELECT TOP 3 d.Num1,d.Num2,COUNT(*) TheCount
FROM
(--Create ALL "pairs" for each date
SELECT t1.Num AS Num1,t2.Num AS Num2
FROM #Test t1,
#Test t2
WHERE t1.Dt = t2.Dt
AND t1.Num < t2.Num
) d
GROUP BY d.Num1,d.Num2
ORDER BY TheCount DESC,Num1,Num2
--Jeff Moden
Change is inevitable... Change for the better is not.
December 6, 2006 at 3:37 am
Did you post int he right forum. I have no idea what you are talking about.
December 6, 2006 at 8:53 am
But, Scott does
Scott had posted the very same question on the WROX forum (totally different URL)... there, they got a little carried away with discussions on Pascal's triangle and how it related to the solution of this seemingly nasty little problem and a whole bunch of other stuff (kinda like folks did here ). Scott has a realtively large number of lotto results to process and, since each 6 digit lotto number has 15 distinct pairs (that's where the talk of Pascal's triangle started), a thousand lotto numbers will actually spawn 15 thousand rows and a solution could (and did) start to get slow (1.3 seconds instead of ~ 100 milliseconds on 10K lotto numbers).
Just in case he gave up on the other forum, I wanted to make sure he got the answer so I posted it here, as well.
By the way, it's also fairly easy to warp my solution to find the most frequent triplets and quadrupelets, as well.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 6, 2006 at 5:57 pm
Good thing I read this thread. Now I know whom to consult when I pick my lotto numbers.
Viewing 8 posts - 16 through 22 (of 22 total)
You must be logged in to reply to this topic. Login to reply