u-vote.eu/uvote/sql/qq/UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL.php
Naeltard e8ff9b4c49 new headbanner
filter system
new api for poll
various small bugfixes
2015-10-23 16:36:36 +02:00

13 lines
623 B
PHP

<?php
namespace SQL;
class UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL extends \SYSTEM\DB\QQ {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT uvote_votes_per_party.party as party,
sum(case when uvote_data.choice = uvote_votes_per_party.choice then 1 else 0 end) class_MATCH,
sum(case when uvote_data.choice != uvote_votes_per_party.choice then 1 else 0 end) class_MISSMATCH
FROM uvote_data LEFT JOIN uvote_votes_per_party
ON uvote_data.poll_ID = uvote_votes_per_party.poll_ID
WHERE uvote_votes_per_party.choice GROUP by party;'
;}}