使用字典映射更改字符串中的值有什么好技巧吗?例如我有table1
FIDDLE
+---------------------------+
| ROW1 |
+---------------------------+
| This is an example string |
| This String has typ0s |
+---------------------------+
还有一些映射表dict1
FIDDLE:
+-------------------------+
| OLD | NEW |
+-------------------------+
| THIS | THAT |
| IS | ARE |
| EXAMPLE | SOURCE |
| STRING | NUMBER |
+------------+------------+
我需要一些SELECT
语句来拆分值table1.row1
并使用映射字典更改单词,dict1
因此接收到的值将是(将不存在的字典值更改为上部是可选的):
+---------------------------+
| TRANS_ROW1 |
+---------------------------+
| THAT ARE AN SOURCE NUMBER |
| THAT NUMBER HAS TYP0S |
+---------------------------+
PS。使用 REGEXP 表达式进行拆分会非常好..