aebstract Posted February 11, 2010 Share Posted February 11, 2010 I need to limit the results I am grabbing from my query, I need to check if the first 5 characters of the column are equal to 'TYSON'. I know how to do this if it's not "first 5 characters" of the column, anyone shed some light on this? Thanks Link to comment https://forums.phpfreaks.com/topic/191777-first-5-char-exact-match/ Share on other sites More sharing options...
aebstract Posted February 11, 2010 Author Share Posted February 11, 2010 A more 'ghetto' way to do this, which I think will work in my situation, will be to grab all results where that column contains 'TYSON' regardless of position and regardless of first 5 characters. I think that would be easier to grab and I may be able to find a solution. Link to comment https://forums.phpfreaks.com/topic/191777-first-5-char-exact-match/#findComment-1010789 Share on other sites More sharing options...
Mchl Posted February 11, 2010 Share Posted February 11, 2010 At least two ways to do this: WHERE columnName LIKE 'TYSON%' WHERE SUBSTR(columnName,1,5) = 'TYSON' Link to comment https://forums.phpfreaks.com/topic/191777-first-5-char-exact-match/#findComment-1010795 Share on other sites More sharing options...
aebstract Posted February 11, 2010 Author Share Posted February 11, 2010 At least two ways to do this: WHERE columnName LIKE 'TYSON%' WHERE SUBSTR(columnName,1,5) = 'TYSON' Excellent, thanks a lot! Link to comment https://forums.phpfreaks.com/topic/191777-first-5-char-exact-match/#findComment-1010803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.