I have a table, where each row represents a train wagon that has been loaded with product. Each row has a "Loading Time" column. However I also have a "Average time over past 3 wagons" column that I need to calculate the last 3 wagons AVERAGE loading time
between them prior to the wagon selected to determine the average loading time for the past 3 wagons. How do I select the data and calculate this in SQL?
↧