Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sql mysql to search record that not begin with

Posted on 2010-11-24
3
329 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
ID: 34210207
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
ID: 34210208
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
ID: 34210519
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

861 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