今天假设是11月2日......
我有这张桌子:
|--------|----------|------------|
| SUB_Id | SUB_Name | SUB_End |
|--------|----------|------------|
| 1 | Banana | 2017-11-02 | <- return this row (diff 0 day)
| 2 | Apple | 2017-11-03 | <- return this row (diff 1 day)
| 3 | Pear | 2017-11-09 | < don't return this row as diff is > 3
|--------|----------|------------|
我正在使用此查询在SUB_End
时获取行 - 今天的日期是&lt; = 3。
SELECT * FROM Subscriptions WHERE SUB_End >= curdate() AND SUB_TrialEnd <= curdate() + interval 15 day
如何从此查询中获得差异?
例如,对于行