SQLite中计算当前日期跟某个日期相差的天数
--(1)日期SELECT DATE();SELECT DATETIME();SELECT JULIANDAY('now');SELECT JULIANDAY(DATE());SELECT JULIANDAY(DATE())-JULIANDAY('-12-15');
SELECT JULIANDAY('now');
SELECT JULIANDAY(DATE());
这两句是一样的效果
最终直接整合到SQL语句中去
select JULIANDAY(DATE())-JULIANDAY(min(date)) as betweenDays from PayInfo where IFNULL(direction,'')<>''
运行效果如下:
如果觉得《SQLite中计算当前日期跟某个日期相差的天数》对你有帮助,请点赞、收藏,并留下你的观点哦!