I've inherited the following query and I'm not sure what the second value being selected is.
Can anyone please shed some light?
Sorry if the question is vague but I've given as many details as I understand.
SELECT
dateId,
row_number() OVER (order by DATEPART(ISO_WEEK, min(myDate)) % 2, myDateId-1) AS DayIdx
FROM table
WHERE masterID=9084141 GROUP BY dateId