Ok, um es ganz klar zu machen, ich habe Tabelle wie folgt aussehen:SQL - Ersetzen Wert der Spalte aus einer anderen Spalte Wert mit der Bedingung
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
Ich möchte wie dieser sein:
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
Wie ändert man den Wert post_title von "product_variation" nach dem Wert von post_type "product" als übergeordnetes Element.
und wenn ich über 1000 Produkt habe, wie kann ich es ändern ...?
6,7,8 sind fix id ersetzen? –
ja es ist feste ID –