Acessar para criar postagens e tópicos.
POSTGRESQL - Transformar coluna do tipo varchar para table com delimitador
#1 · 4 de maio de 2018, 15:38
Citação de Giovani Brollo em 4 de maio de 2018, 15:38Transformar coluna do tipo varchar para table com delimitador.
Documentação oficial: https://www.postgresql.org/docs/9.4/static/functions-string.html
função: regexp_split_to_table(stringtext, pattern text [, flagstext])
exemplo:
Coluna varchar: texto = '1,2,3,4,5';
Query: Select regexp_split_to_table(texto, E',') from tabela;
Saída:
1 2 3 4 5
Transformar coluna do tipo varchar para table com delimitador.
Documentação oficial: https://www.postgresql.org/docs/9.4/static/functions-string.html
função: regexp_split_to_table(stringtext, pattern text [, flagstext])
exemplo:
Coluna varchar: texto = '1,2,3,4,5';
Query: Select regexp_split_to_table(texto, E',') from tabela;
Saída:
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
Clique para não gostei.0Clique para gostei.0