Re: Need help building SQL query

From: "Robert Blixt" <robert(dot)blixt(at)transpa(dot)se>
To: "'Bruno Wolff III'" <bruno(at)wolff(dot)to>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Need help building SQL query
Date: 2005-12-06 07:03:59
Message-ID: 001801c5fa33$3b476d20$1b00a8c0@robertsdator
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> -----Ursprungligt meddelande-----
> Från: pgsql-novice-owner(at)postgresql(dot)org [mailto:pgsql-novice-
> owner(at)postgresql(dot)org] För Bruno Wolff III
> Skickat: den 5 december 2005 17:46
> Till: Robert Blixt
> Kopia: pgsql-novice(at)postgresql(dot)org
> Ämne: Re: [NOVICE] Need help building SQL query
>
> On Mon, Dec 05, 2005 at 10:28:04 +0100,
> Robert Blixt <robert(dot)blixt(at)transpa(dot)se> wrote:
> >
> > Timereportbreak consists of four breaks for
> > each timereport. They are ordered by the
> > indexnumber (0-3). They are connected to the
> > timereport table using the column timereportid.
> >
> > What I would like to retrieve is all columns from timereport
> > and the four timereportbreaks connected to the timereport table.
> > However, since each break is not a separate column I am not
> > sure how to solve this. And since this database already has data
> > in it. I can't remodel the table. This is the output I want:
>
> Normally you want to do this by joining to Timereportbreak once for each
> break (i.e. 4 times) using a different table alias for each join. Then
> you can use the a different condition on indexnumber for each alias to
> get the appropiate break.
>

Thanks for your help, highly appretiated.

Regards,
Robert

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Swierczek 2005-12-06 13:59:35 Re: Need help building SQL query
Previous Message me 2005-12-06 04:44:00 Re: SQL Statement Help Needed