1

我有这个代码:

sqldf("SELECT  account_id, Cash_Payment
       FROM table1
       WHERE created_time BETWEEN MIN(DATE(transactions.created_time))
       AND MAX(DATE(transactions.created_time))")

但这对我不起作用。

我想cash_Payment从创建帐户之日到 7 天(即Cash_Paymnent在为个人用户创建帐户后的第一周)创建用户的查询。

请让我知道如何进行日期操作,即

MIN(DATE(transactions.created_time)) +7days
4

2 回答 2

0

可能你需要使用:

MIN(DATETIME('transactions.created_time','+7 day'))
于 2013-05-10T22:25:43.593 回答
0

也许你可以试试这个:

SELECT  account_id, Cash_Payment
       FROM table1
       WHERE created_time
       BETWEEN DATETIME(transactions.created_time) AND DATETIME(transactions.created_time,'+7 day')
于 2013-05-10T22:26:19.323 回答