开发者社区 问答 正文

检查一条数据在某个时间段是否重复

我要检查同一个客户的合同在同一个时间段内是否有重复的。表结构是这样的
screenshot
怎么写这个sql?

展开
收起
吴孟桥 2016-06-14 11:03:23 1989 分享 版权
1 条回答
写回答
取消 提交回答
  • select * from table where enddate > (select begindate from 表 where id = xxx) and startdate < (select enddate from 表 where id = xxx)

    2019-07-17 19:37:01
    赞同 展开评论
问答分类:
SQL
问答地址: