使用正则表达式和搜索条件比较两个表中的列
Compare columns from two tables using regular expression and search criteria
我需要使用正则表达式将 table.column1 与 table.column2 进行比较,但我还想引入其他搜索条件,如下所示。
regexp_substr(table.column1,'[[:space:]] table.column2 [ $]')
但挑战是我找不到将实际的 column2 包含在搜索条件中的方法。
我认为这与语法错误有关。如果有任何帮助,我将不胜感激。
谢谢,
沙希德
您可以将 column2 的内容连接到表达式。
regexp_substr(t.column1,'[[:space:]] '||t.column2||' [ $]')
我需要使用正则表达式将 table.column1 与 table.column2 进行比较,但我还想引入其他搜索条件,如下所示。
regexp_substr(table.column1,'[[:space:]] table.column2 [ $]')
但挑战是我找不到将实际的 column2 包含在搜索条件中的方法。
我认为这与语法错误有关。如果有任何帮助,我将不胜感激。
谢谢, 沙希德
您可以将 column2 的内容连接到表达式。
regexp_substr(t.column1,'[[:space:]] '||t.column2||' [ $]')