I have this data:
I’m looking for a query which can return the results of combination of Type
(Phone and Memory) based on overlapping of startdate
and enddate
as below:
Thanks
Advertisement
Answer
Probably something like this:
SELECT * FROM table p INNER JOIN table m ON NOT(m.startdate > p.enddate OR m.enddate < p.startdate) WHERE p.Type = 'Phone' AND m.Type = 'Memory'