Given a datetime column in mysql 5, I want to find out the day of the week ?
But the function DAYOFWEEK returns 1 for Sunday.
I want 1 to denote monday, 2 tuesday etc.. and 7 to denote Sunday.
Is there a one-liner (that can be embedded in a larger SQL statement) that implements this function ?
f(x) => y
such that:
f(1) = 7
f(n) = n-1 for n in range [2,7]