Making an ILIKE query by using REPLACE
# help-and-questions
k
I have a postgresql query
Copy code
sql
SELECT name FROM table WHERE REPLACE(name, ' ', '') ILIKE 'kiwi%'
How can I reproduce the replace function this using the supabase JS/TS client?
g
You would probably have to use a generated column to have the result of the replace. A view or rpc call to a postgres function. Otherwise if you know it is one space you could do an or with two ilikes ...
'kiwi%'
or
' kiwi%'
k
Alright thank you