Getting different result on Count Function using >1 inside the bracket. Kindly explain?
Thanks for reaching out.
The difference you're seeing in the result set is due to the incorrect use of the COUNT function, which results in a logical error in the context of what you're trying to achieve. The correct and meaningful use of COUNT() in conjunction with the HAVING clause is demonstrated in solution query, which is why you're seeing expected results there. The second query doesn't logically make sense in the context of your intended use and may produce incorrect or unintended results.
Hope this helps.