Teradata Select Count From Subquery