I am trying to run a query that will have a count field and it will group on an id. However I want to display only if the count field is greater than or equal to 2. I have tried this query but it didnt work.
$sql = "SELECT count(*), companyId FROM company WHERE count(*)>='2' GROUP BY companyId";
Does this not work or do i need to make this a having clause?