Weather Observation Station 4

  • + 1 comment

    Instead of using count(id) > 2 like that, I'd recommend using Distinct. It does what you're looking for more simply, and would eilminate any possible logic errors from your query.

    Try something like Select((Count(City) - Count(Distinct city)) From Station

    That way you can avoid group bys and havings that have a habit of behaving in ways you don't expect, and it makes your query more readable, and I suspect faster.