I have a JDBC query that performs an ILIKE operation.
select project_name from project_table where project_name ILIKE '%test%';
The above returns all the results matching (wildcarded) the term test
.
However, when the project_name is %project_name
and the user searches for just %
, the query returns all the rows instead of just the matching row.
Essentially the query becomes select project_name from project_table where project_name ILIKE '%%%';
I understand the concept of wildcarding in postgresql, but is there a way to just limit the result matching the %
?