Your explantion and questions are very good ..
We want this type of interview questions and crack the very easy for interview.
Thanks for your kind word...
Do share the channel it will help in growing this channel.
Thanks.
Thanks for the explanation
By the way where are you getting the interview questions?
with cte as (select *, (total_sales_revenue-lag(total_sales_revenue,1,0) over(partition by product_id))diff from salesq)
select * from products where product_id = (select product_id from cte group by product_id having min(diff) > 0)