1
There is a Cost Center table called "ccusto", in it, contains Ids ("code" field) that would like to be returned in a SELECT. However, the data needs to be compared to a string with comma separation, which are the values that need to be selected.
Exemplo:
SELECT codigo
FROM ccusto
WHERE codigo IN('1,2,3');
Returno da consulta:
1
Retorno esperado da consulta:
1
2
3
What operator or function can be used in this case?
Hello mcardoso, I don’t know if this is what you’re looking for, but I believe you should change the
IN('1,2,3')
forIN(1,2,3)
, I understand that you want to pass a string in IN but the ideal is to use items of the same column type, I believe that code is an integer, in this case the ideal would be to pass the values as integers separated by comma.– ooredroxoo