select count (*)as cnt from employees group by salary having cnt>3

 If you want to count the number of employees who have the same salary and have more than 3 employees with that salary, you can use the COUNT, GROUP BY, and HAVING clauses together. Here's how you can write the SQL query:


SELECT Salary, COUNT(*) AS cnt FROM Employees GROUP BY Salary HAVING COUNT(*) > 3;

This query will count the number of employees for each unique salary value, and it will only include those salary values where the count of employees with that salary is greater than 3.

No comments:

Post a Comment

React -1 ( react with ravenndra kanchi)

 react with tool chanis 45 to 50 sessions core  after 50 sessions -> some tooll chains == react with type script mern stackaplication in ...