更新时间:2023-12-03 21:52:52
使用整数表,您可以执行以下操作:
Using an integers table, you can do this:
SELECT "key", minDate + INTERVAL i DAY
FROM mytable
INNER JOIN integers
ON i <= DATEDIFF(maxDate, minDate)
当然,假设"integers"表的列名为"i".
That assumes the "integers" table has its column named "i", of course.
从那里可以用INSERT INTO ... SELECT
填充新表.
From there you can populate your new table with INSERT INTO ... SELECT
.