I created a table in psql which is named restraunts to show the rest which all friends have gone to. Here is the table (friends and rest are the column names):

select distinct rest
from restraunts
where friends ilike any ('Micheal','Martin','Jack') and rest ilike any ('Ofelia','Casablanca');
I run the code but I got an error:
ERROR: syntax error at or near ","
LINE 3: where friends ilike any('micheal','martin','jack') and rest ...
^
The error shows at the comma.
Why is this happening and how can I solve it?
The issue in your query is the usage of the
ILIKEoperator in combination with theANYclause. You tried to use theILIKEoperator with a list of values directly, but this is not the correct syntaxHere is the correct way to do it: