Beginner Join question

From: calvin(at)improtech(dot)co(dot)za (Calvin Browne)
To: pgsql-sql(at)postgresql(dot)org
Subject: Beginner Join question
Date: 1998-06-16 15:17:54
Message-ID: m0ylxUh-0012EcC@inlaw.improtech.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Been out of DB programming for a while, and am trying to get back in
with postgres under Linux.

Anyway, my question (should be fairly simple, but the manuals
arn't quite clear) is as follows:

TABLE A ( TABLE B(
record_id record_id
field1 field3
field2) field4)

record_id in both tables are the same.
The record definitely exists in TABLE A, but not
necessarily in TABLE B.

I need to get the following:

record_id | A.field1 | A.field2 | B.field3
-------------------------------------------------------------------
rec1 | xxxx | xxxxxx | Field displayed if there is
| | | a record in B, such that A.record_id
| | | is equal to B.record.id, otherwise
| | | leave it blank.
-------------------------------------------------------------------

I'm going to have about a million records in each table, so
efficiency of the join is a priority. Disk space is not.

Thanks in advance.

--Calvin

-------------------| My opinions are mine |---------------------------------
Calvin Browne webmaster(at)improtech(dot)co(dot)za calvin(at)uniforum(dot)org(dot)za || Linux, NT,
calvin(at)orange-tree(dot)alt(dot)za http://www.uniforum.org.za/~calvin |-|| Jeans,
Page me via: http://www.uniforum.org.za/~calvin/page.html |--|| Sneakers &
Phone: +27 11 805-1000 Fax: +27 11 805-4004 |------|| Talking Heads
-------------| Gotta get this .sig shorter :) |-----------------------------

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jose' Soares Da Silva 1998-06-16 15:24:47 Re: [SQL] handle the MONEY type
Previous Message Karin Probost 1998-06-16 11:03:10 exists with join key of type oid