I have the the following SQL statement:
SELECT [l.LeagueId] AS LeagueId, [l.LeagueName] AS NAME, [lp.PositionId]
FROM (Leagues l INNER JOIN
Lineups lp ON l.LeagueId = lp.LeagueId)
WHERE (lp.PositionId = 1) OR
(lp.PositionId = 3) OR
(lp.PositionId = 2)
What I really need is to get the rows where the count of the position is greater than a number. Something like:
SELECT [l.LeagueId] AS LeagueId, [l.LeagueName] AS NAME, [lp.PositionId]
FROM (Leagues l INNER JOIN
Lineups lp ON l.LeagueId = lp.LeagueId)
WHERE Count(lp.PositionId = 1) > 2 OR
Count(lp.PositionId = 3) > 6 OR
Count(lp.PositionId = 2) > 3
Is there any way to do this in SQL?