【发布时间】:2014-06-30 13:23:24
【问题描述】:
我有两个看起来像这样的表:
table A:
ID, target_date, target_ID
table B:
ID, target_ID, begin_date, end_date
表 B 可能具有相同 target_ID 但不同日期范围的多条记录。我对能够返回不在给定 target_ID 的 begin_date 和 end_date 范围内的 target_dates 的 SQL 查询感兴趣。
【问题讨论】:
-
你能提供你已经尝试过的样品吗?
-
可能没那么重要,但您应该为您正在使用的 DBMS 添加一个标签(Postgres、Oracle、...)