+-------------------------------+
| id subscriber package |
+-------------------------------+
| 1 5553288 heart |
| 2 4443365 love |
| 3 5553288 love |
| 4 3332353 love |
| 5 5845569 tech |
+-------------------------------+
この表を更新したいと思います。
加入者がパッケージのみにサインアップしている場合、love
それを に変更したいheart
.
サブスクライバーがパッケージlove
&を持っている場合heart
。love
の行を削除して、 の行のままにしたいと思いheart
ます。
これを使ってみた
UPDATE subscriber
SET package=`heart
WHERE package=`love`
`
両方のパッケージに参加しているサブスクライバーがいるため、少し機能しません