0

Names:

Watts, Odysseus D.
Schultz, Wilma D. 
Mckinney, Madaline R.  
Charles, Mohammad O.

My table names like this structure, first_name and last_name are in single column called names, i want to get all names from starting with letter 'M' in their last name,

How to write in mysql query for this criteria???

1 Answer 1

2

If the last name appears at the beginning of the string, the you can just do:

select * from names where name like 'M%'

On the other hand, if you want to filter on the first character after the comma, then:

select * from names where name like '%, M%'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.