14.03.2018 20:02, Alexander Farber пишет:
Thank you, Ivan! I am trying to apply your suggestion to my table -
Yes, here x is the alias for the record, not for the json field. So you need to write the query like
select string_agg(x->>'letter', ' ')
from (
select jsonb_array_elements(tiles) x
from words_moves
where gid=656 and action='play'
order by played desc limit 5
) y;
Regards,
Ivan