MySQL Forums
Forum List  »  Newbie

Re: Get 20 most frequent pairs(2/2) and triplets(3/3) of numbers mysql
Posted by: Rick James
Date: December 01, 2015 08:05PM

There are 45 pairs and 120 triplets. Doing the task in SQL would lead to an explosion of data.

Instead, I would write it in PHP (or whatever) --
First, loop through the data:
1. read a line
2. compute the 45 pairs using 2 nested loops, $pairs[$a, $b]++
3. ditto for triplets

Then display the contents of $pairs and $triplets.

Options: ReplyQuote


Subject
Written By
Posted
Re: Get 20 most frequent pairs(2/2) and triplets(3/3) of numbers mysql
December 01, 2015 08:05PM


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.