damil / SQL-Abstract-More

extension to SQL-Abstract with named parameters and support for several additional SQL clauses
https://metacpan.org/pod/SQL::Abstract::More
6 stars 10 forks source link

-having should not require -group_by #21

Closed rouzier closed 2 years ago

rouzier commented 2 years ago

There are cases where group by is not required when using having. The following is valid in mariadb.

SELECT COUNT(*) as count FROM security_event WHERE security_event.mac = "00:00:00:00:00:00" AND tenant_id = 1 AND  status = 'closed' HAVING count(*) = 0;