在db2中,我们要实现截取后2位,使用right函数即可
select right('abcdef',2) from sysibm.dual;
输出结果:ef
但是在Oracle中是没有right这个函数的
既然在Oracle中没有这个语法,那么我们可以使用substr函数来变相实现
select substr('abcdef', length('abcdef') - 1) as res from dual;
输出结果显示: