Skip to content

Instantly share code, notes, and snippets.

@84adam
Created January 4, 2023 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 84adam/36aa9c7e5108dc07475b0e3172478ae0 to your computer and use it in GitHub Desktop.
Save 84adam/36aa9c7e5108dc07475b0e3172478ae0 to your computer and use it in GitHub Desktop.
PostgreSQL: format multiple columns into string for each row using a semicolon as separator between fields
### PostgreSQL: format multiple columns into string for each row using a semicolon as separator between fields
```
SELECT
FORMAT('%s; %s; %s; %s',
col_one, col_two, col_three, col_four)
AS entries
FROM table_name;
```
#### easily split text-to-columns using ";" separator in spreadsheet apps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment