[英]Extracting data from the link and placing it in a new column
我有幾個鏈接:
Column1 Column2
---------------
<a href=" https://link; m=date1>Link</a> date1
<a href=" https://link; m=date2>Link</a> date2
<a href=" https://link; m=date3>Link</a> date3
結果列應如下所示:
Column1 Column2 Column3
---------------
<a href=" https://link; m=date1>Link</a> date1 date1
<a href=" https://link; m=date2>Link</a> date2 date2
<a href=" https://link; m=date3>Link</a> date3 date3
我想從鏈接中提取 (date1, date2, date3) 並且添加到 Column3 的值與 column2 中的值一致。
我不知道應該使用什么查詢?
您可以使用:
select col1, col2, case when regexp_like(col1,col2) then col2 end as col3
from t
只是檢查列 col2 的值存在於 col1 中,並生成 col3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.