aritimetics with count(*) postgre code example
Example 1: select count postgres double row count > 1
SELECT
firstname,
lastname,
count(*)
FROM people
GROUP BY
firstname,
lastname
HAVING count(*) > 1;
Example 2: postgresql select fast check no rows
select exists (select 1 from mytable)