[sql] Using union and count(*) together in SQL query