Timeline for Complex query to count votes with a redistribution system
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 10, 2015 at 9:04 | history | edited | 200_success | CC BY-SA 3.0 | Updated DB versions for SQL Fiddles, adding SQL Server. Fixed floating-point division on SQL Server. |
| Jan 21, 2015 at 8:07 | history | edited | 200_success | CC BY-SA 3.0 | Oops, both SQLFiddles were the same. |
| Jan 21, 2015 at 0:53 | history | bounty awarded | rolfl | ||
| Jun 14, 2014 at 21:00 | history | edited | 200_success | CC BY-SA 3.0 | Start counting rounds from 1. Renamed CTEs "elected" → "electees", "per_candidate_redistribution" → "perLelectee_redistribution" |
| Jun 14, 2014 at 20:48 | history | edited | 200_success | CC BY-SA 3.0 | Start counting rounds from 1. Renamed CTEs "elected" → "electees", "per_candidate_redistribution" → "perLelectee_redistribution" |
| Jun 14, 2014 at 12:31 | comment | added | Kristofer Gisslén | The redistribution column most certainly calculates the wrong value though. It's related to the way decimals are rounded.I actually don't know how to manage my way around it. :( | |
| Jun 14, 2014 at 12:30 | comment | added | 200_success | The same query runs on MS SQL Server. | |
| Jun 14, 2014 at 12:29 | comment | added | Kristofer Gisslén | This is absolutely awesome. I will take all these recommendations into consideration. I need to stick to MySQL since my host only supports MySQL and MSSQL. Back to the calculations - as I mentioned in an earlier comment this calculation should be correct (I've corrected the typo in my question) since it's my understanding that surpluses and eliminations are calculated in separate rounds. This ugly query of mine is just the calculation of a winners surplus. To get the elimination redistribution I need to add an all new (and much more pretty) query. :) | |
| Jun 14, 2014 at 12:19 | history | edited | 200_success | CC BY-SA 3.0 | added 29 characters in body |
| Jun 14, 2014 at 12:09 | history | answered | 200_success | CC BY-SA 3.0 |