Reputation: 117
In my database ,I have two record in a table, one's value is "201612" ,the other one is "20171" ,how to get "201701" when I query this table ? thanks
Upvotes: 0
Views: 42
Reputation: 39467
Something like this maybe:
select
case when col > 99999 then col
else 100 * (col / 10) + (col % 10)
end as col
from your_table;
Upvotes: 1