I need to create a SELECT statement with a column which alternates between two values from day to day. Values are 1 and 2.
I was thinking about:
But this does not work in transition from 31st to 1st day of next month.
I could create some advanced SQL with case statements to check previous month etc, but this syntax should be as easy as possible since this will be exposed as self service to users.