SQL query examples
Revision as of 09:03, 17 September 2018 by old>Admin (Created page with " === Lookup related data === SELECT l.`Value`, COUNT(k.DataID) FROM data_kuglespil as k JOIN formfieldlookup as l ON k.STRRELSE = l.LookupID; === Grouped variables ==...")
SELECT l.`Value`, COUNT(k.DataID) FROM data_kuglespil as k JOIN formfieldlookup as l ON k.STRRELSE = l.LookupID;
Grouped variables
SELECT 'Under 5' as Text, COUNT(k.DataID) FROM data_kuglespil as k WHERE k.RESULTAT <= 5 UNION SELECT 'Middel (6-16)' as Text, COUNT(k.DataID) FROM data_kuglespil as k WHERE k.RESULTAT <= 5 AND k.RESULTAT < 17 UNION SELECT 'Top performer (17)' as Text, COUNT(k.DataID) FROM data_kuglespil as k WHERE k.RESULTAT = 17;