Skip to main content
Asked a question 3 months ago

Postgress DB, I need to return just the first and then the second part of a field based on "," as a seperator, field contains "abcd, 12345, zyxw" I need to have a fomula return just "abcd" or "12345"

Where am I?

In DashboardFox you can ask and answer questions and share your experience with others!


   Please take a look at the PostgreSQL function split_part().


split_part('abcd, 12345, zyxw', ',',2)

should return: 12345

Note: if you have spaces in the string you may need to then trim them:

trim(split_part('abcd, 12345, zyxw', ',',2))



Related Questions

No related questions.