Any help with this would be greatly appreciated. I need to create a query and my SQL skills are very very rusty.
Lets say I have the following;
Database name = users
Table name = info1
Table type is NVARCHAR 40
Info1 can contain the following type of data;
<NULL>, all numbers ie.. 111122223333444 4, or alphanumeric ie.. JAMISON/ JOHN8
Here is my challenge. I need an update query to go through every record and if it is of type "all numbers" ie.. 111122223333444 4, I want to keep the last 4 numbers and replace the rest with 0. So the resulting record would be 000000000000444 4.
Can one of you SQL genius's help me with this. I'm stumped.
Lets say I have the following;
Database name = users
Table name = info1
Table type is NVARCHAR 40
Info1 can contain the following type of data;
<NULL>, all numbers ie.. 111122223333444 4, or alphanumeric ie.. JAMISON/ JOHN8
Here is my challenge. I need an update query to go through every record and if it is of type "all numbers" ie.. 111122223333444 4, I want to keep the last 4 numbers and replace the rest with 0. So the resulting record would be 000000000000444 4.
Can one of you SQL genius's help me with this. I'm stumped.
Comment