PostgreSQL Basic SELECT Statement: Check whether the first_name column of the employees containing any number

17. Write a query to check whether the first_name column of the employees table containing any number.

Sample Solution:


FROM employees 
WHERE  first_name 
SIMILAR TO   '%0|1|2|3|4|5|6|7|8|9%';

Sample table: employees


 employee_id | first_name | last_name | email | phone_number | hire_date | job_id | salary | commission_pct | manager_id | department_id
(0 rows)

Practice Online

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query to get the first name, last name and the length of the name, including first_name and last_name of all the employees from employees table.
Next: Write a query to select first ten records from a table.

What is the difficulty level of this exercise?

Share this Tutorial / Exercise on : Facebook and Twitter