Relative Content

Tag Archive for sqlpostgresqlfunctiondate

function calls an Id with a date between two dates of another table

I have 2 tables about KPI in PostgreSQL, the first table tab1 contains: “Id”, “Start_Date”, “End_Date” …
and the second table tab2 contains: “Kpi_Id” (fk tab1), “Date” …
In fact, “Start_Date” is for the start of the week and “End_Date” is for the end of the week for a whole year (exp: year =2023, “Start_Date”=’2023-01-01′ and “End_Date”=’2023-01-08′)