Re: Problems with joining two table

From: <kaiq(at)realtyideas(dot)com>
To: "Rudolph, Michael" <Michael(dot)Rudolph(at)telekom(dot)de>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Problems with joining two table
Date: 2000-04-19 14:16:43
Message-ID: Pine.LNX.4.10.10004190911440.11738-100000@picasso.realtyideas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

you need a sql book: you sumarized your question so well, you can find the
answer in any sql book in a minute, literally:

select
a.some, a.someelse, a.reference,
b.referee, b.somesome, b.somesomeelse
from tableA a, tableB b
where b.referee = a.refference

hope helps.

Kai
On Wed, 19 Apr 2000, Rudolph, Michael wrote:

> Hi,
>
> I have two tables, the first one has one column as a reference to the index of the second. Not every row in the first table has a reference to the second table. I now want to make a query to get all information of the first table and, if there is a reference, the corresponding information of the second table in that row. In another programming language I would just make an if-clause but how can I do this in SQL?
>
> Thanks for your help
>
> Michael
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2000-04-19 17:12:11 TOAST (was: BLOB)
Previous Message M.Mazurek 2000-04-19 13:59:32 Re: Query Times