select substr('12345',greatest( -位数,-length('12345')),位数) from dual (ps:位数是数字) 转载于:https://my.oschina.net/u/780705/blog/706963