Numeric Codes Without Failures

Numeric Codes Without Failures

Session IDs in the old event log are messy, with values such as s1 mixed in. For every event, return event_id and code by safely converting session.id to INT64: an invalid value must produce NULL instead of failing the query.

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. Your answer must use the same column names as this sample — alias them with AS if needed.

event_idcode
1NULL
2NULL
3NULL
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid