Re: [SQL] Aggregate over a linked list

2013-01-17 Thread Venky Kandaswamy
...@postgresql.org [pgsql-sql-ow...@postgresql.org] on behalf of M Lubratt [mplubr...@gmail.com] Sent: Thursday, January 17, 2013 3:19 PM To: pgsql-sql@postgresql.org Subject: [SQL] Aggregate over a linked list Hello! I trade futures contracts and I have a PostgreSQL 9.2 database that keeps track

[SQL] Aggregate over a linked list

2013-01-17 Thread M Lubratt
Hello! I trade futures contracts and I have a PostgreSQL 9.2 database that keeps track of all of my trading activity. The table includes columns for the futures contract, the entry and exit dates and the profit for that particular trade. Now, futures contracts expire, so within a trade being ind