separate SQL field

0

I have the following table with the following data

select * from archivo_final

    cs_promocion      3
d_promocion       DSCTO NESPRESSO
st_promocion      A
fecha_desde       2017-07-04
fecha_hasta       2017-12-31
almacenes         109,111,113,114,117,118,120,121,124,126,128,130,132,134,135,1
                  38,140,141,143,144
d_definicion      Al comprar un minimo de
cn_comprar        1
grupo_definicion  3
nombre            NESPRESSO
inclu_definicion  plano sku:6164,6165,6170,6177,6178,8636,8637,8638,13010,13011

inclu_descuento
exclu_definicion
exclu_descuento
act_definicion    1
act_descuento

With the information that is in the field inclu_definicion, I must make a join with another table to get other information.

The problem is that in this record is stored as a string, there is some way to separate each sku in a different field

    
asked by Norbey Martinez 02.11.2017 в 17:19
source

1 answer

1

Try using Split Example:

SELECT value FROM STRING_SPLIT('Lorem ipsum dolor sit amet.', ' ');

This will generate a table with each element according to your separator. In this case:

Lorem
ipsum
dolor
sit
.....
    
answered by 02.11.2017 в 17:34