Reputation: 4941
I'm looking for an SQL statement that will return only rows of my table whose Name field contains special characters (single quotes).
I used
SELECT * FROM 'table' WHERE Name REGEXP '"$'
What do i miss to put here ?
Upvotes: 1
Views: 3429
Reputation: 2200
MySQL 5.5.30 Schema Setup:
create table test(name varchar(10));
insert into test
values('aaa '''' bb'),('bsbds');
Query 1:
select *
from test
where name regexp "'"
| NAME |
-------------
| aaa '' bb |
Upvotes: 2
Reputation: 1204
For single quotes alone
select * from `table` WHERE Name REGEXP "'";
If you need more special symbols like ' % $
select * from `table` WHERE Name REGEXP "['%$]";
Upvotes: 1