Solved

sql mysql to search record that not begin with

Posted on 2010-11-24
3
325 Views
Last Modified: 2012-08-13
How can i search record that not be gin with  'abs' or  'cat' or  'f'a
0
Comment
Question by:teera
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 250 total points
Comment Utility
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
 
LVL 58

Expert Comment

by:cyberkiwi
Comment Utility
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
 
LVL 2

Assisted Solution

by:jingks03
jingks03 earned 250 total points
Comment Utility
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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now