One of the most common interview question in #sql round. What is the order of execution of the below #query:
""""Query""""""
Select product_id,
product_rank
(
SELECT product_id,
rank() over(order by total_sales_amount desc) as product_rank
FROM sales_info
)
WHERE product_rank <= 5
order by product rank desc;
""""Query""""""
Select product_id,
product_rank
(
SELECT product_id,
rank() over(order by total_sales_amount desc) as product_rank
FROM sales_info
)
WHERE product_rank <= 5
order by product rank desc;
👍8❤3