2016-08-26 12:43:45 +00:00
|
|
|
INSERT INTO reference_rate (moneda_id, date, rate)
|
|
|
|
SELECT 2, TIMESTAMPADD (DAY, 1, r1.date), r1.rate
|
|
|
|
FROM reference_rate r1
|
|
|
|
LEFT JOIN reference_rate r2
|
|
|
|
ON TIMESTAMPADD(DAY, 1, r1.date) = r2.date
|
2017-09-13 07:51:57 +00:00
|
|
|
WHERE r2.date IS NULL AND r1.date < TIMESTAMPADD (DAY, -2, CURDATE())
|