MySQL Forums
Forum List  »  Newbie

Re: How to detect two overlapping date ranges with the same primary key?
Posted by: Владислав Сокол
Date: December 29, 2021 12:18AM

SELECT *
FROM productcosthistory t1
WHERE NOT EXISTS ( SELECT NULL
FROM productcosthistory t2
WHERE t1.PKey = t2.PKey
AND t1.EndDate BETWEEN t2.StartDate AND t2.EndDate )

Options: ReplyQuote


Subject
Written By
Posted
Re: How to detect two overlapping date ranges with the same primary key?
December 29, 2021 12:18AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.