Solved

MySQL query to exclude numeric results?

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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