Fixed getting the count for queries with the union
Merge pull request #2850 from Koudy/db-query-queryScalar

Fixed getting the count for queries with the union