Does anybody know of a query I can use to find distinct values within a partition?