Advertisement
NanoBob

Wordfeud competition SQL query

May 19th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.42 KB | None | 0 0
  1. SELECT id,omschrijving,COUNT(deelnemer.account_naam) AS deelnemerAantal,
  2. (CASE (
  3.     SELECT deelnemer.account_naam
  4.     FROM competitie
  5.     JOIN deelnemer ON competitie.id = deelnemer.competitie_id
  6.     WHERE deelnemer.account_naam='jager684' AND competitie.id = comp.id)
  7. WHEN  'jager684' THEN true ELSE false END)
  8. AS neemtDeel
  9. FROM competitie as comp
  10. JOIN deelnemer ON comp.id = deelnemer.competitie_id
  11. GROUP BY comp.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement