Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

find emp_id that does not contain a digit

SOLVED
Go to solution
Ratzie
Super Advisor

find emp_id that does not contain a digit

How do I set up an sql query to check if emp_id contains at least 1 digit?
2 REPLIES
spex
Honored Contributor
Solution

Re: find emp_id that does not contain a digit

Hi,

This query returns emp_id's not containing at least one digit:

SELECT emp_id
FROM employees
WHERE emp_id NOT IN
(SELECT emp_id
FROM employees
WHERE emp_id LIKE '%0%' or emp_id LIKE '%1%' or
emp_id LIKE '%2%' or emp_id LIKE '%3%' or
emp_id LIKE '%4%' or emp_id LIKE '%5%' or
emp_id LIKE '%6%' or emp_id LIKE '%7%' or
emp_id LIKE '%8%' or emp_id LIKE '%9%');


PCS
Ratzie
Super Advisor

Re: find emp_id that does not contain a digit

excellent