Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sql mysql to search record that not begin with

Posted on 2010-11-24
3
Medium Priority
?
344 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
[X]
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
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 1000 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 1000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 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