这些是我的表
我正在尝试编写一个查询,我可以在事件表或特定日期表中的specific_date中搜索天气搜索天气的开始和结束日期之间的日期,并从事件中检索记录
例如:
select * from events left join specificdates on events.event_id=specificdates.event_id WHERE ('2017-01-29' BETWEEN events.start_date AND events.end_date) OR ('2017-01-29' IN
specificdates.spefific_date)
答案 0 :(得分:1)
尝试这个
select * from events left join specificdates on events.event_id=specificdates.event_id
WHERE ('2017-01-29' BETWEEN
events.start_date AND events.end_date) OR (specificdates.spefific_date IN ('2017-01-29'))