bitternut

event_trackers_extends

Oct 19th, 2021
641
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE VIEW `event_trackers_extends`
  2.             AS
  3.             SELECT
  4.                 *,
  5.                 JSON_EXTRACT(event_json, '$.event.exhibitorId') AS exhibitor_id,
  6.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') = 'panel_video' THEN 1 END AS panel_video,
  7.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') LIKE '%panel_poster%' THEN 1 END AS panel_poster,
  8.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') LIKE '%panel_banner%' THEN 1 END AS panel_banner,
  9.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') = 'panel_gallery' THEN 1 END AS panel_gallery,
  10.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') IN ('"panel_avatar"', '"panel_assistant"') THEN 1 END AS panel_assistant,
  11.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') = 'panel_info' THEN 1 END AS panel_info,
  12.                 CASE WHEN JSON_EXTRACT(event_json, '$.event.target') = 'join_meeting' THEN 1 END AS join_meeting
  13.             FROM `event_trackers`;
RAW Paste Data