I have this tiny table with just "fecha" field in it.
I need a MySQL
query that inserts every sunday and saturday of the year to the table.
My own research got me to the point where i know i need to do something like this:
DECLARE diaRecorrido date();
SET diaRecorrido = date(now());
WHILE DATEPART(WEEKDAY,diaRecorrido) = 1 or DATEPART(WEEKDAY,diaRecorrido) = 7
BEGIN
INSERT INTO feriados (fecha)
VALUES (diaRecorrido)
IF diaRecorrido=2017/01/01
THEN
LEAVE lazo;
END IF;
END;
Any guidance is much apreciated!