I am using postgres database and I have an array inside a json attribute in a jsonb column and I need to get the first element of that array. The jsonb_column structure is like the below:
"IndustryCode": {
"Code": "111110",
"Keys": [
"11",
"111",
"111110"
],}
So far I can get all the query elements by issuing the query below
select jsonb_array_elements(jsonb_column->'IndustryCode'->'Keys' ) from myindustry;
How can I query to get the first element?