Home > database >  According to the content of the field in the table, on the basis of batch replace another table fiel
According to the content of the field in the table, on the basis of batch replace another table fiel

Time:09-24

Table 1
ID replace content
1 'box'
2 'box'
3 'bottle'
4 'barrels'
5 '3'
6 '6'
7 'pack'
. .
. .
Table 2
Product name
'apple 3 cases of'
'bananas 5 boxes'
'6 bottled juice'

According to the table 1: "replace contents" to replace the content, the cycle of inside the "product name" table 2 contents are replace

Results:
'apple'
'bananas 5'
'juice'

CodePudding user response:

The building Lord baidu listagg and regexp_replace these two functions,