Если вы хотите РАЗОБРАТЬ всю строку SQL, вы можете сделать что-то вроде
// Spring Data allows you to specify the entity you want to distinct after the word "Distinct"
List<CustomerContact> findDistinctMobileByCustomerId();
// Or before the word "Distinct"
List<CustomerContact> findMobileDistinctByCustomerId();
как получить различное число
List<CustomerContact> listCustomerContact = yourRepository.findDistinctMobileByCustomerId(10001)
listCustomerContact.size();
Я предполагаю, что у вас есть данные, подобные этому
CUSTOMER_ID MOBILE
10001 ________ A
10001 ________ A
10001 ________ B
10001 ________ C
Результатколичество выходных данных различное мобильное = 3
Более подробную информацию об этом вы можете проверить в Spring Data Documentation