I would like to make a query in PostgreSQL
select
distinct on(uuid)
(select nr_zew from bo_get_sip_cti_polaczenie_info(uuid)) as nr_zew
from bo_sip_cti_event_day
where data_ins::date = current_date
and kierunek like 'P'
and (hangup_cause like 'NO_ANSWER' or hangup_cause like 'NO_USER_RESPONSE')
in Java as far I have
Result<Record> result = create
.select()
.from("bo_sip_cti_event_day")
.where("data_ins::date = current_date")
.and("kierunek like 'P'")
.and("(hangup_cause like 'NO_ANSWER' or hangup_cause like 'NO_USER_RESPONSE') ")
.fetch();
and it works but as I try to add
Result<Record> result = create
.selectDistinct("uuid")
.from("bo_sip_cti_event_day")
.where("data_ins::date = current_date")
.and("kierunek like 'P'")
.and("(hangup_cause like 'NO_ANSWER' or hangup_cause like 'NO_USER_RESPONSE') ")
.fetch();
then it says that cannot do selectDistinct(String).
How can I use distinct in jOOQ?