Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Netezza 数据库并尝试仅从字段中获取最后 10 位数字(字符串)。
这是我所拥有的一个例子:
XMCC123456789
我想得到的是:C123456789
如果您安装了 Netezza SQL Extensions Toolkit,那么您可以使用它:
select sql_functions.admin.strright(s.sample,10) from (select 'XMCC123456789' as sample) s
否则很长的路是:
select substr(s.sample,length(s.sample)-9,10) from (select 'XMCC123456789' as sample) s