mysql - sql : allow same period for just two entries -


i have table provider (id , name, startdate , enddate ) confirm insertion of 1 provider on : 2 conditions: - there no other providers in period or second provider in period.

i need make verification sql request

select count(p.*) provider p p.startdate < :newenddate , p.enddate >= :newstartdate 

the use of < vs. <= , > vs. >= depends on notion of overlapping of intervals.


Comments