SQL server move data from one column to another

Viewed 33

I have a table like below:

Id value
1. Doc
1. Doc
1. Doc
2. Txt
2  Txt

I only want to display "doc" in a new column using alias. How can I do it?

1 Answers

If you need just split one column with 3 letters like in your example, you could use RIGHT function:

SELECT Id, RIGHT(Id, 3) FROM yourTable

Related