Im trying to add and save a new calculated column to the table energy, using the following sql query:
ALTER TABLE energy
ADD energie_active_1 float
SELECT *,
energie_active - LAG(energie_active, 1, energie_active)
OVER (
PARTITION BY DESIGNATION
ORDER BY TS)
FROM energy
But i get the column energie_active_1 empty and a new column without name with the calculated values (as shwon in the image) Query result
I dont use sql queries a lot, so any help or advice would be very appreciated.
Thank you.