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.
我需要编写 oracle sql 查询以在每个下划线字符后仅从字符串中选择前 3 个字符。
例如:
'oracle_mydatabase_table'- 原始字符串,
'oracle_mydatabase_table'
'ora_myd_tab' - 所需的输出。
'ora_myd_tab'
任何人都可以帮我编写 sql 查询或 pl/sql 程序来做到这一点吗?
regexp_replace(your_string, '((^|_)[^_]{1,3})[^_]*', '\1')