Skip to content

Cannot extract Json value from json column #22800

Answered by martint
DenGodunov asked this question in Q&A
Discussion options

You must be logged in to vote

For json_extract/json_extract_scalar, you need to change the JSON path to $.birth_date["$date"]. It doesn't support quoted path elements.

json_query doesn't yet support JSON type as input. It needs to operate on a VARCHAR. To get around that limitation, you can first convert the JSON value to VARCHAR via json_format:

json_query(json_format(a), 'strict $.birth_date."$date"' omit quotes)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DenGodunov
Comment options

@martint
Comment options

Answer selected by DenGodunov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #22799 on July 24, 2024 17:27.