我有一个与学生(学生=1)的数据集,我需要每周监控这些学生。如何筛选特定日期的数据,然后在7天后和14天后对其进行监视?像这样的。只有这一部分起作用: (CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor, I think the
date_add`给了夫人格里夫,因为它是在抱怨布尔类型
Select *,
(CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor,
(CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 7)) THEN 1 ELSE 0 END) AS date_to_monitor,
(CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 14)) THEN 1 ELSE 0 END) AS date_to_monitor,
from old;
暂无答案!
目前还没有任何答案,快来回答吧!