how to get the count of a query in pssql code example Example: postgresql select fast check no rows select exists (select 1 from mytable)