I have the code presented below provided to me by one of the members but I do not understand how it acts:
select pdam.*, pr.*
from "DAMPay" as pdam left join lateral
(select min(pr."AsigStart") as startt
from "PolsRisc" as pr
where pdam."PRID" = pr."Index"
) pr
on true;
The code extracts the min of start from another table. I wanna add an aditional condition like:
where pdam."PAYDate" between '2020-06-01' and '2020-06-30'
I cannot insert the condition without an error. Also, I need only to see min(pr."AsigStart") from the pr table not all columns (pr.*). Thanks