I need a column that gives me the difference of a column of a previous row and current row. I am able to achieve this using a select statement. Using
SELECT *,`open` - LAG(`close`,1,`open`) over (order by `open`) as `previous_day_close` FROM backtestData.NSE_RELIANCE ;
The table looks like this after running the query