Hmm, so if you perform a join then group by say customer_id, how will you get the latest 3 orders? Any thoughts? How will the SQL query look like in that case?
with cte as (select customer_id, order_id, order_date, RANK() OVER(partition by customer_id order by order_date desc) as rnk from ordors), cte2 as(select customer_id, order_id,order_date from cte where rnk
your video intro..I'll say..." I like it " ❤
Haha, yeah I just keep trying different things here and there.
can't we use Group by instead of window function brother?
Hmm, so if you perform a join then group by say customer_id, how will you get the latest 3 orders? Any thoughts? How will the SQL query look like in that case?
Give error ,says no agrigate fun used here , 😅
with cte as (select customer_id, order_id, order_date,
RANK() OVER(partition by customer_id order by order_date desc) as rnk from ordors),
cte2 as(select customer_id, order_id,order_date from cte where rnk