#829

Extract `target` from each click's payload

In events the payload is stored as JSONB and may contain any set of keys. For events of type click the payload has a target key — the name of the button the user pressed. Analytics wants a list of every click along with its target. For each event of type click extract the target value from payload (as a string) and return the event id together with that value. Sort by id.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

idtarget
3buy
10buy

Your query result will appear here