sql mysql to search record that not begin with

How can i search record that not be gin with  'abs' or  'cat' or  'f'a
teeraAsked:
Who is Participating?
 
cyberkiwiConnect With a Mentor Commented:
select * from tbl
where (not col like 'abs%' and not col like 'cat%' and not col like 'f''a%')

not sure if you deliberately meant f-dash-a
otherwise, the last part would be not col like 'f%'
0
 
cyberkiwiCommented:
select * from tbl
where (not col like 'abs%' and not col like 'cat%' and not col like 'f''a%')

not sure if you deliberately meant f-dash-a
otherwise, the last part would be not col like 'f%'
0
 
jingks03Connect With a Mentor Commented:
In addition, if you are familiar (or more comfortable) with regular expressions, you could always use something like

SELECT * from tbl WHERE col REGEXP '^(abs|cat|f''a)';
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.