The documentation tells me LIKE and NOT LIKE are used in SQL to search if cells contain/starts/ends with certain characters.
I'm trying to use this in PostgreSQL which tells me the operator does not exist. My query:
SELECT * FROM "City"."models"
WHERE (("City"."models".identifier NOT LIKE'%$%')
AND
(("City"."models".id LIKE '%2%')
OR
("City"."models".id LIKE '%1%')))
ORDER BY "City"."models".town_id ASC LIMIT 10
Column types:
identifier->uuid
id->int
town_id->int
Where is my mistake?
LIKEis not applicable to integers, you'll have to use something likeCAST(id as VARCHAR) LIKE '%2%'etc. But that looks weird in general, why do you want to filter integers like text?LIKE