Simple question in regards to MOD alternative in SQL SERVER. I know it the SQL SERVER MOD is written as % but that usually requires a number % number. My question is how can I use the % when I have these clauses in the code:
GROUP BY LeagueID
HAVING MOD( COUNT(1), 2 ) > 0
WHEN num_teams + num_fake - 1
ELSE MOD( away_idx + 1, num_teams + num_fake - 1 )
don't quite understand the logic of your query.
anyway . . . here is how you used the MOD %
SELECT NULL, LeagueID, COUNT(1), 1, COUNT(1), 1 FROM Team GROUP BY LeagueID HAVING COUNT(1) % 2 > 0