Solved

MySQL query to exclude numeric results?

Posted on 2008-10-22
2
792 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 500 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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