正则表达式排除tableau和SQL DB

时间:2017-05-09 04:54:01

标签: sql oracle

以下是一些示例数据:

Customer node "4142" is cancelled as at 02/02/2010..

这是预期的输出:

Customer node is cancelled

引号之间的值应排除并打印到特定单词。在此示例中,它应该打印到cancelled

1 个答案:

答案 0 :(得分:0)

尝试以下查询:

SELECT REGEXP_REPLACE(SUBSTR(col, 1, INSTR(col, 'cancelled') - 1),
                      '(".*")\s',
                      '') AS new_col
FROM yourTable
相关问题