select distinct count sql query