MySQL Select names with last names ending with certain letter
Posted
by Brian
on Stack Overflow
See other posts from Stack Overflow
or by Brian
Published on 2010-03-11T05:39:43Z
Indexed on
2010/03/11
5:43 UTC
Read the original article
Hit count: 394
mysql
I have a MySQL database with a field Name which contains full names. To select all people with last names ending in a particular letter, let's say A for this example, I use the following query: SELECT * FROM db WHERE Name LIKE '% A%'
. However, this also selects users who have a middle name starting with A. Is there anyway to alter this query so that only a last name ending in A will be selected?
© Stack Overflow or respective owner