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

create cartoon video using ai

  https://www.piclumen.com/ using this we can crate cartoon photos https://hailuoai.video/ its not free upto 1000 points we canuse it for fr...