Mysql SQL-用条件替换另一列值中的列值
好,说得很清楚,, 我的桌子是这样的:Mysql SQL-用条件替换另一列值中的列值,mysql,database,wordpress,woocommerce,Mysql,Database,Wordpress,Woocommerce,好,说得很清楚,, 我的桌子是这样的: ID post_title post_type ------------------------------------------------------ 1 product A product 2 product A - Size S product_variation 3
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
如何将“产品变更”的值后标题更改为“产品”类型后的值作为父项
如果我有大约1000个产品,我如何更改它…?您可以使用替换功能
update tableName set post_title=REPLACE(post_title,'A','B') where ID in(6,7,8)
6,7,8是修复id?是的,它是修复的,请先在演示中尝试,如果可行,然后在原版中尝试谢谢你的查询,但是我在adminer上成功地完成了,因为我有大约7000个产品。我是如何批量更换的?这就是为什么我要问你身份证的原因。你应该告诉我你的全部问题。。如果我把你弄糊涂了,很抱歉,但我不知道如何用简单的方式准确地说出这个问题。我不知道;I don’我不知道你说的是什么意思,身份证是不是修好了。