Finding overlap between different customers || EBay Question

Question

Q1: An overlap means that the date range of customer overlaps (partial or complete overlap) with the date range of all the other customers. Write a query to reach the required output

Table Name: Subscription
USER ID START DT END DT
U1 2020-01-01 2020-01-31
U2 2020-01-16 2020-01-26
U3 2020-01-28 2020-02-06
U4 2020-02-16 2020-02-26

Output we need:
User_id Overlap
U1 TRUE
U2 TRUE
U3 TRUE
U4 FALSE

1
Shubham Tandon 3 years 0 Answers 454 views Newbie 0

Leave an answer

Browse
Browse