如何在MySQL中的另一个表中填充一个表中的数据

时间:2016-09-15 06:24:15

标签: mysql triggers

我在MySQL的收费数据库中有两个表,即 traffic_shift_wise traffic_day_wise 。这些表的列如下:

traffic_shift_wise

toll_id    date         shift    car_single    car_return    car_total
1          2016-09-01   1        25            10            35
1          2016-09-01   2        50            25            75
1          2016-09-02   1        100           50            150
1          2016-09-02   2        200           100           300

traffic_day_wise

toll_id    date            car_single       car_return      car_total
1          2016-09-01      75               35              110
1          2016-09-02      300              150             450

特定通行费每天有两个班次,您可以看到我必须在插入后自动将 traffic_shift_wise 中的数据转移到 traffic_day_wise 强> traffic_shift_wise

所以,请帮我解决这个问题。我该怎么用,触发..?

0 个答案:

没有答案
相关问题