ROW_NUMBER() OVER (ORDER BY {trandate}), that retu...
# general
m
ROW_NUMBER() OVER (ORDER BY {trandate}), that returns the row number based on the ordering of the results, 1,2,3,4,5,6 etc MOD(x,2) that returns the remainder when that row number is divided by 2 so you get 0,1,0,1,0,1