Relational algebra: Difference between dates

259 views Asked by At

Which function should I use to express the difference of dates. End and Start date differences must be more than 3 days.

σ EndDate - StartDate > 3 (Residence)

Error at line 1: function "sub" expects arguments of type "number,number" but "date,date" given

Schema

Residence= {
UID:number, HID:number, StartDate:date, EndDate:date

1, 1, 2022-03-03, 2022-03-06
2, 1, 2022-03-03, 2022-03-07
3, 1, 2022-03-03, 2022-04-08
1, 2, 2022-03-03, 2022-03-06
2, 2, 2022-03-03, 2022-03-07
3, 2, 2022-03-03, 2022-04-04
1, 3, 2022-03-03, 2022-03-06
2, 3, 2022-03-03, 2022-03-07
3, 3, 2022-03-03, 2022-04-10
}

Online editor

0

There are 0 answers