日期:2014-05-16 浏览次数:20702 次
select * from tablename a where exists(select 1 from tablename where start>a.start and start<a.end and end>a.start and end<a.end and name=a.name) or exists (select 1 from tablename where start<a.start and end>a.end and name=a.name);
------解决方案--------------------
select * from 表 a ,表 b where a.start<=b.start and a.end>=b.end and a.id!=b.id