Answer the question
In order to leave comments, you need to log in
Why is there an error in the SQL query?
I am writing a request to check the available data for the presence of elements in the pattern:
select model
from product
where model like '_2%' and model like '%1'
ERROR: ОШИБКА: оператор не существует: integer ~~ unknown
LINE 3: where model like '_2%' and model like '%1'
^
HINT: Оператор с данными именем и типами аргументов не найден. Возможно, вам следует добавить явные приведения типов.
SQL state: 42883
Character: 39
Answer the question
In order to leave comments, you need to log in
select model
from product
where cast(model as text) like '%1'
union
select model
from product
where cast(model as text) like '_2%'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question