题解 | #判断其是否有过购买记录#

判断其是否有过购买记录

https://www.nowcoder.com/practice/5cddad8995974b0c915ab89961428ee0

select 
    customer_id,
    if (latest_place_order_date is not null, 1, 0) as if_placed_order
from
    customers_info

因为表中用的是“latest_place_order_date” 最后一次下单日期,所以每个customer_id只有一条记录;如果这是一个订单记录表,又如何处理呢?

刷题!刷题! 文章被收录于专栏

刷题一键转化~~

全部评论

相关推荐

酷酷我灵儿帅:这去不去和线不线下面说实话没啥关系
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务