w3resource

Oracle: List the names of those employees whose first name has only five characters and last name have third alphabet ends with 's'

Oracle Wildcard special Operator: Exercise-6 with Solution

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'.

Sample table: employees


Sample Solution:

Oracle Code:

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

Output:


FIRST_NAME           LAST_NAME
-------------------- -------------------------
David                Austin
Laura                Bissot
Clara                Vishney

Pictorial Presentation:

Pictorial: List the names of those employees whose first name has only five characters and last name have third alphabet ends with 's'

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 and starts with ‘A’.
Next: Write a query to list the names (first and last) of the employees whose first name has only five characters and starting with 'S' and ending with 'n'.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.