
Originally Posted by
ilikecubing
Request for list of top 10 ppl with biggest difference between their 4x4 single and average
Hi Ayush,
Here it is,
Code:
+----------+----------+------------+----------------------------+------------+-----------------+
| pbAvg | pbSgl | difference | personName | personId | personCountryId |
+----------+----------+------------+----------------------------+------------+-----------------+
| 422.4800 | 195.6100 | 226.8700 | Kenn-Eerik Kannike | 2009KANN01 | Estonia |
| 412.4900 | 206.6500 | 205.8400 | Aman Agrawal | 2012AGRA01 | India |
| 322.2900 | 133.3800 | 188.9100 | Marine Asalia | 2009ASAL01 | India |
| 468.9800 | 292.3400 | 176.6400 | Saarthi Bhatia | 2009BHAT02 | India |
| 375.8900 | 203.7200 | 172.1700 | Indrek J├Áe | 2009JOEI01 | Estonia |
| 335.5800 | 175.5700 | 160.0100 | Dariusz Peta | 2005PETA01 | Poland |
| 332.6100 | 173.7200 | 158.8900 | Eduardo González Parra | 2011PARR03 | Mexico |
| 337.4900 | 180.3800 | 157.1100 | Krzysztof Boryczko | 2005BORY01 | Poland |
| 317.9600 | 161.3000 | 156.6600 | Rebecca Hughey | 2007HUGH04 | USA |
| 369.9200 | 219.0800 | 150.8400 | Patrick Garcin | 2008GARC05 | France |
+----------+----------+------------+----------------------------+------------+-----------------+
Based on Stefan's code few pages before.
Code:
SELECT pbAvg, pbSgl, pbAvg-pbSgl difference, personName, personId, personCountryId
FROM (SELECT min(if(average>0,average/100.00,1111111111)) AS pbAvg, min(if(best>0,best/100.00,1111111111)) AS pbSgl, personName, personId, personCountryId
FROM results
WHERE eventId = '444'
GROUP BY personId) helper
WHERE pbAvg<1111111111 AND pbSgl<1111111111
ORDER BY difference DESC
LIMIT 10
For the smallest difference:
Code:
+---------+---------+------------+-------------------------------------------------+------------+-----------------+
| pbAvg | pbSgl | difference | personName | personId | personCountryId |
+---------+---------+------------+-------------------------------------------------+------------+-----------------+
| 80.6600 | 80.1900 | 0.4700 | Muhammad Bintang Assyidik | 2010ASSY01 | Indonesia |
| 57.4400 | 56.7200 | 0.7200 | Erwan Kohler | 2010KOHL02 | Switzerland |
| 66.0700 | 64.7700 | 1.3000 | Yukiko Makino (þëºÚçÄþö▒Õ©îÕ¡É) | 2007MAKI01 | Japan |
| 74.8800 | 73.5600 | 1.3200 | Mateusz Burnicki | 2006BURN01 | Poland |
| 75.6500 | 74.2800 | 1.3700 | Zijing Jin (ÚçæÕ¡ÉÚØû) | 2011JINZ01 | China |
| 70.9700 | 69.5600 | 1.4100 | Sakai Taisyu (ÕØéõ║òÕñºÕæ¿) | 2012TAIS01 | Japan |
| 82.0000 | 80.5600 | 1.4400 | Bo-Zhou Xiao | 2009XIAO01 | Taiwan |
| 59.6600 | 58.1600 | 1.5000 | Dakota Allen Harris | 2008HARR03 | USA |
| 58.7200 | 57.1500 | 1.5700 | Julian David | 2010DAVI06 | Canada |
| 51.6800 | 50.0200 | 1.6600 | Marcin Zalewski | 2011ZALE02 | Poland |
+---------+---------+------------+-------------------------------------------------+------------+-----------------+
Bookmarks