Reputation: 101
Considering XPT table containing the following values:
123, 443, 213, 124
I want to update it remove the last character of each number in order to get it like this:
12, 44, 21, 12
Upvotes: 0
Views: 1696
Reputation: 40481
Use SUBSTRING()
function:
SELECT SUBSTRING(t.value, 1, 2)
FROM XPT t;
Or if you want to update:
UPDATE XPT t
SET t.value = SUBSTRING(t.value, 1, 2);
Upvotes: 1