Skip to content

Instantly share code, notes, and snippets.

@mattm

mattm/com-id.sql

Created Apr 6, 2018
Embed
What would you like to do?
Extracting a JSON value
SELECT
properties,
JSON_EXTRACT_SCALAR(properties, "$.com_id") AS com_id
FROM mp.event
WHERE name = "Signed Up"
LIMIT 1
+-----------------+--------+
| properties | com_id |
+-----------------+--------+
| {"com_id":1234} | 1234 |
+-----------------+--------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.