Data explorer query for events?

You can make it a bit easier to read without remembering the codes too if you add in a little something like this:


-- [params]
-- topic_id :topic_id

SELECT ei.user_id,
      CASE 
       WHEN ei.status = 0 THEN 'Going' 
       WHEN ei.status = 1 THEN 'Interested'
       WHEN ei.status = 2 THEN 'Not going' 
        END AS "Going?"
FROM discourse_post_event_invitees ei
JOIN posts p ON p.id = ei.post_id 
WHERE p.topic_id = :topic_id
ORDER BY ei.status