OK使其很清楚, 我有表如下所示:SQL - 從另一列值替換列的值與條件
ID post_title post_type
------------------------------------------------------
1 product A product
2 product A - Size S product_variation
3 product A - Size M product_variation
4 product A - Size L product_variation
5 product B product
6 product A - Size S product_variation
7 product A - Size M product_variation
8 product A - Size L product_variation
9 product C product
10 product A - Size S product_variation
11 product A - Size M product_variation
12 product A - Size L product_variation
13 product D product
14 product A - Size S product_variation
15 product A - Size M product_variation
16 product A - Size L product_variation
我想是這樣的一個:
ID post_title post_type
------------------------------------------------------
1 product A product
2 product A - Size S product_variation
3 product A - Size M product_variation
4 product A - Size L product_variation
5 product B product
6 product B - Size S product_variation
7 product B - Size M product_variation
8 product B - Size L product_variation
9 product C product
10 product C - Size S product_variation
11 product C - Size M product_variation
12 product C - Size L product_variation
13 product D product
14 product D - Size S product_variation
15 product D - Size M product_variation
16 product D - Size L product_variation
如何改變「product_variation」以下post_type「產品」的值作爲父母的價值POST_TITLE。
,如果我有1000左右的產品,我能怎樣改變......?
6,7,8是修正標識? –
是的,它是固定的ID –