【发布时间】:2021-08-04 21:20:28
【问题描述】:
我需要在 sql 中为 id_customers 写一个 bool 列:
If there is a purchase this month and if there is a purchase in the past, then 1.
If there is a purchase this month, but not in the past, then 0.
First frame:
id_customers | sale_date
Total frame:
id_customers | sale_date | bool
感谢您的提前
【问题讨论】:
-
用您正在使用的数据库标记您的问题。样本数据和期望的结果将有助于确保您的问题是明确的。
-
数据库未打开
-
请尝试一下,展示您所做的事情以及任何特定的问题/问题,否则您似乎希望有人来做您的工作。 SO 不是免费的编码服务。
标签: sql google-bigquery