Jump to content


This topic is now archived and is closed to further replies.


please check if correct

Recommended Posts

hey there, I have a column of type varchar that contains something that looks liek the following

Cat 002
Cat 002
Cat 003
Cat 005
Cat 107


What 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.


Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.