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.
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?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework