Germaris Posted September 14, 2008 Share Posted September 14, 2008 Hi there ! I maintain a database of former students (more than 32000 entries). I wish to build a query to retrieve in lastName field all and only the two letter names it contains. Something like: $query =mysql_query ("SELECT school, lastName, firstName, promo, region, gone FROM $table WHERE lastName LIKE XXXXXX ORDER BY lastName, firstName, school, promo" ) What should I write where the XXXXXX are? Sorry to be somehow... stupid! And many thanks in advance for your help! Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 14, 2008 Share Posted September 14, 2008 WHERE CHAR_LENGTH(lastName) = 2 Quote Link to comment Share on other sites More sharing options...
Germaris Posted September 14, 2008 Author Share Posted September 14, 2008 This was too simple for my tired mind !!! Thank you SO MUCH ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.