select field text separated by comma return lines

1

Does anyone know how it is possible in postgresql to get a value inside a field of type TEXT that has comma-separated records to use in WHERE ?

Example of values in the field (35693,35694,35695,35696,35697,35698,35699,713)

Example

Select * from tabela where id = '35693'

But the value in where is inside a comma-separated string, like breaking and comparing?

    
asked by anonymous 26.02.2015 / 15:58

1 answer

1

I was able to resolve using:

UNNEST(ARRAY[string_to_array(campo_pesquizar, ',')])::INT
    
26.02.2015 / 17:18