Writing Sql Command Count Distinct Values