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?
- 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