s

postgresql get the nth element from comma separated list edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 25 February 2022 | 1055

How to get the nth element from comma-separated list in postgresql

Solution

below query returns the 5th element from comma separated liste

select split_part('hello, world, this, is, a, test',',',5)