Database iterative sql syntax

problem description

to get data for all semester weeks, use SQL syntax

the environmental background of the problems and what methods you have tried

related codes

4 attributes, academic year semester, start time, end time, start week, end week

what result do you expect? What is the error message actually seen?

want all dates in 1-23 weeks, such as
2017-2018-1 2018-3-31 2018-4-06 1
2017-2018-1 2018-4-06 2018-4-13 2
2017-2018-1 2018-4-13 2018-4-20 3
2017-2018-1 2018-4-20 2018-4-27 4
2017-2018-1 2018-4-27 2018-5-35
.
2017-2018

different database solutions are fine. I have tried to use tmp table to add sequences and carry out internal association.
but I don"t want to use ordinal lists

.
Apr.12,2021

can be solved by stored procedures and executed in a loop

SELECT Term, BeginDate, DATE_ADD (current date, INTERVAL 7 DAY), current number of weeks FROM term_info
current date = DATE_ADD (current date, INTERVAL 7 DAY)
current number of weeks + 1

results are saved to temporary table

Menu