pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Deruwe <a@deruwe.be>
To: pgsql-sql@postgresql.org
Subject: Linking against null-fields.
Date: Tue, 9 Oct 2001 13:24:00 +0000
Message-ID: <20011009112958.074132178C9@tartarus.telenet-ops.be> (raw)

Hey all,

I'm sorry if this question came up before, I couldn't find it in the 
archives..

Suppose I have two tables:

table File: contains alot of fields + 'driver' field, which refers to another 
table. I did not 'reference' it when creating the database because 
null-values have to be possible for this field.

Now, if in this File-table the field 'driver' is not filled in, the row will 
not be included in a query such as this one:

SELECT f.ID, d.NAME FROM FILE f, DRIVER d WHERE (d.ID = f.DRIVER);

However, the only reason I have this query set up as this is to get the name 
of the driver easily, if one is set.

How can this be helped? Should I just get the driver ID as a field, and then 
do a second query on that?

Thanks,

Alexander Deruwe



view thread (3+ messages)  latest in thread

Message-ID: <20011009112958.074132178C9@tartarus.telenet-ops.be>
Permalink:  ../20011009112958.074132178C9@tartarus.telenet-ops.be/
Also on:    postgresql.org/message-id/20011009112958.074132178C9@tartarus.telenet-ops.be

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: a@deruwe.be
  Subject: Re: Linking against null-fields.
  In-Reply-To: <20011009112958.074132178C9@tartarus.telenet-ops.be>

* 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