I write the query in postgresql I have store the data in json format of one column and now I need the particular value of the json
message_data :{"apiMessageId":"162fbbbe8f0e2a67","userEmail":"[email protected]","cloudId":1}
This is data and I want to only userEmail and this is my query
SELECT id, process_id, process_state, cast(message_data->> \'userEmail\' AS VARCHAR) AS userEmail, inserted_at, completed_at
FROM realtimeincomingemailnotificationsqueue
where api_message_id = '162fbbbe8f0e2a67';
cast(message_data->> 'userEmail')::varchar, but it istextanyway, so I dont see any need in additional cast'userEmail'rather than\'userEmail\'