Can someone assist me to write a query on Table1 below that creates a new field that shows the cost for an item one year ago.
Table1.
Date Item Amount
1/april/2002 Car 100.00
1/april/2003 Car 200.00
1/april/2004 Car 300.00
1/april/2002 Truck 400.00
1/april/2003 Truck 500.00
1/april/2004 Truck 600.00
*** Desired Table - with a new field that shows the amount of an item 1 year ago.
Date Item Amount Amount_last_year
1/apr/2002 Car 100.00 0
1/apr/2003 Car 200.00 100.00
1/apr/2004 Car 300.00 200.00
1/apr/2002 Truck 400.00 0
1/apr/2003 Truck 500.00 400.00
1/apr/2004 Truck 600.00 500.00
Table1.
Date Item Amount
1/april/2002 Car 100.00
1/april/2003 Car 200.00
1/april/2004 Car 300.00
1/april/2002 Truck 400.00
1/april/2003 Truck 500.00
1/april/2004 Truck 600.00
*** Desired Table - with a new field that shows the amount of an item 1 year ago.
Date Item Amount Amount_last_year
1/apr/2002 Car 100.00 0
1/apr/2003 Car 200.00 100.00
1/apr/2004 Car 300.00 200.00
1/apr/2002 Truck 400.00 0
1/apr/2003 Truck 500.00 400.00
1/apr/2004 Truck 600.00 500.00