Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

MySQL String Exercises: Display the length of first name for employees where last name contain character 'c' after 2nd position

MySQL String: Exercise-13 with Solution

Write a query to display the length of first name for employees where last name contain character 'c' after 2nd position.

Sample table: employees


Code:

SELECT first_name, last_name FROM employees WHERE INSTR(last_name,'C') > 2;

Sample Output:

first_name		last_name
Neena			Kochhar
Nandita			Sarchand
Peter			Tucker

MySQL Code Editor:

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

Previous:Write a query to display the first word from those job titles which contains more than one words.
Next:Write a query that displays the first name and the length of the first name for all employees whose name starts with the letters 'A', 'J' or 'M'.

What is the difficulty level of this exercise?