postgresql-for-doctrine icon indicating copy to clipboard operation
postgresql-for-doctrine copied to clipboard

How to use TO_JSON with JSON_GET_FIELD_AS_TEXT

Open dmitryuk opened this issue 3 years ago • 0 comments

I want to get sql like select (np.params::json)->> 'slug', np.params is a text field

DDL:

JSON_GET_FIELD_AS_TEXT(TO_JSON(np.params), 'slug')

Finally got an error: Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 110: Error: Expected Doctrine\ORM\Query\Lexer::T_INPUT_PARAMETER, got 'np' What I do wrong?

dmitryuk avatar Aug 17 '22 11:08 dmitryuk