w3resource

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:

Code:

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

Sample table: employees


Output:

 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.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming