Reputation: 4941
im using Like to select all data which has single quote in name like Jon's
.
select * from users where file_name like '%'%';
I then want to remove the '
from all results.
Ideas?
Upvotes: 0
Views: 1663
Reputation: 324521
Double quotes in SQL to escape them:
select * from users where file_name like '%''%';
(For any vaguely recent PostgreSQL version; the non-standard escape-string phrasing E'%\'%'
will work with even very old PostgreSQL versions, but not other databases.)
It sounds like you want to remove those characters from the file names. If so, something like the untested:
update users
set file_name = replace(file_name, '''', '')
should do the trick.
Upvotes: 2