Reputation: 4831
Sample results before string manipulation:
COLUMN1 |
-----------
A343jsk |
------------
Jsdefss |
------------
Vdkekd |
------------
Nod |
------------
An |
------------
How do I achieve:
343jsk |
------------
sdefss |
-----------
dkekd |
-----------
od |
-----------
n |
-----------
I tried this:
SELECT
COLUMN1 - LEFT(COLUMN1,1)
FROM
Table
however this does not work. Obviously I can't use RIGHT
because result strings are not all the same length.
Upvotes: 0
Views: 608
Reputation: 300827
Use SUBSTRING():
SELECT
SUBSTRING(COLUMN1, 2, LEN(COLUMN1) - 1)
FROM
Table
Alternatively, (as @David Faber pointed out) you could use:
SELECT
RIGHT(column1, LEN(column1) - 1)
FROM
Table
[I personally prefer the first form]
Upvotes: 4