table1
value= の列とid_month
value =の列があり、6 から 12 に更新する必要があります。value= のすべての行を選択し、to を変更して計算 + 新しい値を作成するには、この変更の効果が必要です。の新しい日付で更新します。1
months
6
table2
id_months
1
months
12
date_start
months
date_end
table1 がそのように
id_month | months
1 | 6
2 | 12
table2 はそのように
id | id_month | months | date_start | date_end
1 | 1 | 6 | 2016-01-01 | 2016-07-01
2 | 1 | 6 | 2016-03-01 | 2016-09-01
3 | 1 | 6 | 2016-06-01 | 2016-12-01
4 | 1 | 6 | 2016-08-01 | 2017-02-01
ありがとうございました。