Querying By Leading Letter

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
luketheduck
Forum Newbie
Posts: 18
Joined: Mon Apr 19, 2004 9:13 am
Location: Aylesbury, Bucks, UK

Querying By Leading Letter

Post by luketheduck »

Trying to query a list of names using the leading letter (say A for now) of the surname.

What I've tried is:

Code: Select all

SELECT * FROM player where secondname = 'A%'
But this doesn't work, and no records are returned. What am I doing wrong?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

SELECT * FROM `player` WHERE `secondname` LIKE 'A%'
User avatar
luketheduck
Forum Newbie
Posts: 18
Joined: Mon Apr 19, 2004 9:13 am
Location: Aylesbury, Bucks, UK

Post by luketheduck »

Brilliant, thanks.
Post Reply