Re: [SQL] Need help building this query

2012-06-21 Thread rihad
> You seem to be describing a straight reconciliation between two tables. > My > current means of doing this are programmatically but for the simple case > pure SQL should be doable. The main thing is that you have to distinguish > between "duplicate" records first and then match them up: > > Tabl

Re: [SQL] Need help building this query

2012-06-21 Thread rihad
> You seem to be describing a straight reconciliation between two tables. > My > current means of doing this are programmatically but for the simple case > pure SQL should be doable. The main thing is that you have to distinguish > between "duplicate" records first and then match them up: > > Tabl

Re: [SQL] Need help building this query

2012-06-21 Thread rihad
gt; > Best, > Oliver > > - Original Message - > From: "Rihad" > To: > Sent: Thursday, June 21, 2012 6:48 PM > Subject: [SQL] Need help building this query > > >> Hi, folks. I currently need to join two tables that lack primary keys, >> and

Re: [SQL] Need help building this query

2012-06-21 Thread Oliver d'Azevedo Christina
:50 PM Subject: Re: [SQL] Need help building this query For matching triples (foo, bar, baz) the date in table B shouldnt always be after any date in table A, as table B contains complete operations? Best, Oliver - Original Message - From: "Rihad" To: Sent: Thursday, J

Re: [SQL] Need help building this query

2012-06-21 Thread Oliver d'Azevedo Christina
For matching triples (foo, bar, baz) the date in table B shouldnt always be after any date in table A, as table B contains complete operations? Best, Oliver - Original Message - From: "Rihad" To: Sent: Thursday, June 21, 2012 6:48 PM Subject: [SQL] Need help building

Re: [SQL] Need help building this query

2012-06-21 Thread David Johnston
> -Original Message- > From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql- > ow...@postgresql.org] On Behalf Of Rihad > Sent: Thursday, June 21, 2012 1:49 PM > To: pgsql-sql@postgresql.org > Subject: [SQL] Need help building this query > > Hi, folks. I cu

[SQL] Need help building this query

2012-06-21 Thread Rihad
Hi, folks. I currently need to join two tables that lack primary keys, and columns used to distinguish each record can be duplicated. I need to build statistics over the data in those tables. Consider this: TableA: row 1: foo: 123, bar: 456, baz: 789, amount: 10.99, date_of_op: date row 2: foo