假设我要选择两个日期之间的所有记录,再加上该日期之前的一个记录和该日期之后的一个记录?所有记录均按日期排序。
(select * from t where date < start_date order by date desc limit 1) union (select * FROM t WHERE date between start_date and end_date) union (select * from t where date > end_date order by date asc limit 1)