As a Rookie in SQL I have a problem creating a query.
Here is the problem : I would like to check on a table if there are lines that share the same DATES.
For example I would like to know if in TABLE A, there are cases like this :
ID | LIB | START_DATE | END_DATE
01 | A1 | 01-01-2016 | 05-03-2016
02 | A2 | 03-03-2016 | 05-06-2016
Those lines are SURVEYS and I would like to know if an admin created a survey that is starting during an other survey. I did some searches on AUTO JOIN but this wasn't really what I was looking for.
My case is a bit more complicated but I will find out myself if you explain how to proceed on this simple case.
Best Answer
Must be something like:
This fetches you the
ID
s where theSTART_DATE
orEND_DATE
(ofs2
) is in the period of anotherSTART_DATE
andEND_DATE
(s1
).