题解 | #某宝店铺连续2天及以上购物的用户及其对应的天数#
某宝店铺连续2天及以上购物的用户及其对应的天数
https://www.nowcoder.com/practice/63ac3be0e4b44cce8dd2619d2236c3bf
select user_id,indicator from (select user_id,count(sales_date-rn) as indicator from (select sales_date,user_id, row_number()over(partition by user_id order by sales_date) as rn from (select distinct sales_date,user_id from sales_tb) as ds ) as t group by user_id) as con where indicator >= 2