Re: Help with join syntax sought

From: Andy Colson <andy(at)squeakycode(dot)net>
To: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
Subject: Re: Help with join syntax sought
Date: 2009-05-19 21:34:24
Message-ID: 4A1325E0.5040908@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James B. Byrne wrote:
> On Tue, May 19, 2009 16:41, Andy Colson wrote:
>
>> If your query above is getting you mostly what you want, just use it
>> as a derived table.
>>
>
> I lack the experience to understand what this means.
>
> If, as you suggest, I use a subquery as the expression to the main
> SELECT and for it I use the syntax that returns every distinct
> combination of base, quote, timestamp, and type, then what?
>
> Unless I am missing something then I still have too many rows for
> those currencies with more than one type.
>

I was not offering a specific answer, just another tool you could use to
massage the data more. What I'm saying is, with that first query you
got the data into a new format.... Think of that result set as a table
itself.

As if you had done:

create table tmp (lots of field);
insert into tmp select (that big query you first posted)

now can you select from tmp to get your answer? Once again, I may be
leading you down the wrong path, and as I said before I don't know your
data/layouts, and I didn't study your sql very much.

-Andy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-05-19 21:39:15 Re: origins/destinations
Previous Message Andy Colson 2009-05-19 21:29:45 Re: Help with join syntax sought