Mysql Where clause with calendar week and for loop

时间:2016-01-06 10:36:02

标签: mysql loops calendar where

i need a WHERE Clause for MYSQL to select in a Table with a timestamp a calendar week from Monday to Sunday.

For example i am in calendar week 2 of 2016 on Wednesday and i need a WHERE Clause to get the data BETWEEN Monday and Sunday von calendar week 1 of 2016. I the next step i need an integer which i can count up to get the calendar week 52 of 2015 from Monday to Sunday and calendar week 51 in the next step.

Something like a For-Loop to get for example 10 different SQL Queries from the actual week back to the past.

Can someone help me with this?

Thanks a lot.

Cu kami

0 个答案:

没有答案