PostgreSQL ? operator for jsonb in Write SQL

Hi all, i am having trouble writing ‘?’ key exist operator for jsonb SQL query on Metabase Write SQL.

The query is like

SELECT metadata ? ‘key1’ FROM table1
ORDER BY inserted_at DESC

but metabase return error like

No value specified for parameter 1.

I am suspecting that ‘?’ is readed as parameterized SQL here, is there a way to write these ‘?’ query?


Hi @calvin_sadewa
You are seeing this issue: - upvote by clicking :+1: on the first post
You can use double question marks instead, like
SELECT metadata ?? 'key1' FROM table1

1 Like

Thanks @flamber, it’s working with ??!