jonaHill87 Posted June 15, 2008 Share Posted June 15, 2008 Hi all. I'm trying to query a last name field in my table beginning with specific letters. So for example if I want to retrieve names beginning with "b", I need to query the first character of the field for each record. I thought I could use "LIKE" but correct me if I'm wrong, "LIKE" searches for the first occurance of "b" in the string. Link to comment https://forums.phpfreaks.com/topic/110279-solved-query-for-specific-first-character-from-field/ Share on other sites More sharing options...
Barand Posted June 15, 2008 Share Posted June 15, 2008 WHERE name LIKE 'b%' will find those beginning with "b" WHERE name LIKE '%b%' will find those containing "b" Link to comment https://forums.phpfreaks.com/topic/110279-solved-query-for-specific-first-character-from-field/#findComment-565857 Share on other sites More sharing options...
jonaHill87 Posted June 15, 2008 Author Share Posted June 15, 2008 Ah. Ok, great. Thanks, I was using the second percentage one. Thanks. Link to comment https://forums.phpfreaks.com/topic/110279-solved-query-for-specific-first-character-from-field/#findComment-565862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.