Re: Linking against null-fields. - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Linking against null-fields.
Date
Msg-id 006901c150df$e335d690$014ba8c0@myst.com
Whole thread Raw
In response to Linking against null-fields.  (Alexander Deruwe <a@deruwe.be>)
List pgsql-sql
> 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?

I think this might work:
select f.ID, d.NAME from FILE f LEFT OUTER JOIN  DRIVER d ON(d.ID=f.DRIVER);



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



pgsql-sql by date:

Previous
From: Janning Vygen
Date:
Subject: Re: Problem with n to n relation
Next
From: "Josh Berkus"
Date:
Subject: Re: Loading current_user and current_timestamp using COPY