mATOK Posted August 16, 2006 Share Posted August 16, 2006 hey there, I have a column of type varchar that contains something that looks liek the followingCat 002Cat 002Cat 003Cat 005Cat 107etcWhat I would like to do is remove the 'Cat ' from every record and be left with only the three digit number.do I want to execute - UPDATE substring(category, 5, len(category)-4) ?I'm pretty new to these types of commands and would apreciate confirmation / correction.thanx Link to comment https://forums.phpfreaks.com/topic/17737-please-check-if-correct/ Share on other sites More sharing options...
fenway Posted August 16, 2006 Share Posted August 16, 2006 If it's always 3 digits, you can do the following:UPDATE yourTable SET yourColumn = RIGHT( yourColumn, 3)But you'd probably want to run an equivalent select query first just to be sure. Link to comment https://forums.phpfreaks.com/topic/17737-please-check-if-correct/#findComment-75739 Share on other sites More sharing options...
mATOK Posted August 21, 2006 Author Share Posted August 21, 2006 Thank You! :D Link to comment https://forums.phpfreaks.com/topic/17737-please-check-if-correct/#findComment-78037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.