?
Solved

MySQL query to exclude numeric results?

Posted on 2008-10-22
2
Medium Priority
?
795 Views
Last Modified: 2012-06-22
Evening folks!

I have an interesting question. Is it possible to exclude results of a given type from a MySQL Query?

For example, if I wanted to find all locations for products that did NOT have a number in their name.

I.E.
(assume a simple table with just the 2 fields mentioned below, both varchar(20) )

SKU                LOCATION
---------------------------------
SKU1                SOD (included in the query output)
SKU2                34A (not included in the query output)
SKU3                ABC (included in the query output)
SKU4                CLO (included in the query output)
SKU5                CLO34A (not included in the query output)


Thanks!
0
Comment
Question by:jmoriarty
[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 Comments
 
LVL 1

Accepted Solution

by:
nick_bal earned 2000 total points
ID: 22783083
select * from tablename where location not REGEXP '[[:digit:]]';
0
 

Author Closing Comment

by:jmoriarty
ID: 31509065
Perfect! Thanks!
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this article, we’ll look at how to deploy ProxySQL.
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
Course of the Month12 days, 15 hours left to enroll

777 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