Re: Need help building SQL query

Поиск
Список
Период
Сортировка
От Sugrue, Sean
Тема Re: Need help building SQL query
Дата
Msg-id 8FDC0F9BE1F91D44BE964AA54AAA67B6189B4C8D@wilmexm3.ad.analog.com
обсуждение исходный текст
Ответ на Need help building SQL query  ("Robert Blixt" <robert.blixt@transpa.se>)
Ответы Re: Need help building SQL query  (<operationsengineer1@yahoo.com>)
Re: Need help building SQL query  (William Yu <wyu@talisys.com>)
Список pgsql-novice
Who can I ask about large scale use of postgresql installations in a
large company? What are the gotchas? Why
would you pay for Oracle if can use postgresql especially if it's just
for data warehousing and not a transactional.

Sean


-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Bruno Wolff III
Sent: Monday, December 05, 2005 11:46 AM
To: Robert Blixt
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Need help building SQL query

On Mon, Dec 05, 2005 at 10:28:04 +0100,
  Robert Blixt <robert.blixt@transpa.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.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

В списке pgsql-novice по дате отправления:

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Date Format Question
Следующее
От:
Дата:
Сообщение: Re: Need help building SQL query