some additions

This commit is contained in:
msyu
2025-08-17 23:32:57 +03:00
parent a58d6e666c
commit 3d2a6a3552
31 changed files with 1514 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
select hash, count(*), count(distinct siv.date_nop), count(distinct d."_plannedDueDate"), count(distinct GREATEST(siv.date_nop,d."_plannedDueDate")) from elma.deals_services siv
left outer join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
left outer join elma.deals d on (d.__id = ANY(siv.deal))
where d.__status_status in(5,6) group by hash having count(distinct GREATEST(siv.date_nop,d."_plannedDueDate")) > 1
--