我有我希望按日期选择记录的情况,但是由于我需要为其添加days_gap
,因此每条记录的记录选择日期不同。根据每个记录指定的日期分别选择记录
所以,我需要类似的东西:
`select from user_options where email_sent_at < time_now - days_gap`
这可能吗?
DB结构: user_options
user_id | email_sent_at | days_gap
1 | 2016-07-27 | 2
2 | 2016-07-24 | 2
3 | 2016-07-22 | 5
4 | 2016-07-21 | 3
选择从user_options其中email_sent_at
Bert
@Bert做出回答出来的共享伯特 – Drew