Question
Hive query for functions
I'm a newbie, I want to calculate month on month percentage change in price change in my table. Im using hive and using query:
select year(stock_date),month(stock_date),sum(stock_price) over (partition by year(stock_date),month(stock_date) ORDER BY month(stock_date)), PERCENT_RANK() OVER(ORDER BY month(stock_date) DESC) AS per from table4;
it's generating, It's showing July 2019 at the top and goes descending thru the numbers. how do I get the months in correct order and the percentage change with it?

can anyone help me understand what am I doing wrong?

