select df_location_key, count(distinct bd_sanumber) from t group by df_location_key;