pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: calvin@improtech.co.za
To: pgsql-sql@postgresql.org
Subject: Beginner Join question
Date: Tue, 16 Jun 1998 17:17:54 +0200 (SAT)
Message-ID: <m0ylxUh-0012EcC@inlaw.improtech.co.za> (raw)

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@improtech.co.za calvin@uniforum.org.za || Linux, NT,
calvin@orange-tree.alt.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 :) |-----------------------------



view thread (2+ messages)  latest in thread

Message-ID: <m0ylxUh-0012EcC@inlaw.improtech.co.za>
Permalink:  ../m0ylxUh-0012EcC@inlaw.improtech.co.za/
Also on:    postgresql.org/message-id/m0ylxUh-0012EcC@inlaw.improtech.co.za

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: calvin@improtech.co.za
  Subject: Re: Beginner Join question
  In-Reply-To: <m0ylxUh-0012EcC@inlaw.improtech.co.za>
  References: <m0ylxUh-0012EcC@inlaw.improtech.co.za>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox