I am new to SQL. I need in big query to add a NEW column "Duration" with a calculation that is the diff of ended_at and started_at, and added to the existing table, I don't want to create a new table.I am using:
SELECT TIMESTAMP_DIFF(ended_at, started_at, MINUTE) AS DurationFROM total_bike
but this creates a new table.
I was able to create a new table with this, but I dont know how to include the calculation:ALTER TABLE total_bike
ADD COLUMN Duration Int
How can I do both in one query?