我有这张桌子:
+--------+------------+---------------------+------+
| id | product_id | pa_value_name | oesd |
+--------+------------+---------------------+------+
| 1 | 120972 | | 0 |
| 9 | 84147 | 1-2 business days | 0 |
| 3255 | 12 | 1-3 business days | 0 |
| 260220 | 124881 | 10-12 business days | 0 |
| 641906 | 147053 | 11-13 business days | 0 |
| 650680 | 139790 | 12-14 business days | 0 |
| 702408 | 112249 | 13-15 business days | 0 |
| 705013 | 223960 | 14-16 business days | 0 |
| 736335 | 124882 | 15-17 business days | 0 |
| 765595 | 106570 | 16-18 business days | 0 |
+--------+------------+---------------------+------+
我希望通过在* pa_value_name *字段中获取“到”日期来更新 oesd 字段。
例如:
+--------+------------+---------------------+------+
| id | product_id | pa_value_name | oesd |
+--------+------------+---------------------+------+
| 9 | 84147 | 1-2 business days | 2 |
+--------+------------+---------------------+------+
在第2行(id = 9): oesd 必须 2 ,因为它应该从“1- 2 商家获得'2'天“* pa_value_name *的值。
谢谢!