w3resource

Oracle: List the names of those employees whose first name has only five characters and starts with 'A'

Oracle Wildcard special Operator: Exercise-5 with Solution

Write a query to list the names (first and last) of those employees whose first name has only five characters and starts with ‘A’.

Sample table : employees


Sample Solution:

Oracle Code:

SELECT  first_name, last_name  
FROM employees 
WHERE first_name like ’A%’ and length(first_name) = 5;

Output:

FIRST_NAME           LAST_NAME
-------------------- -------------------------
Allan                McEwen
Alana                Walsh

Pictorial Presentation:

Pictorial: List the names of those employees whose first name has only five characters and starts with 'A'

Improve this sample solution and post your code through Disqus.

Previous: Write a query to list the names (first and last) of those employees whose first name has only five characters.
Next: Write a query to list the names (first and last) of those employees whose first name has only five characters and last name have third alphabet ends with 's'.

What is the difficulty level of this exercise?



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/oracle-exercises/wildcard-special-operators/oracle-wildcard-special-operators-exercise-5.php