pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Hagerty <matthew@venux.net>
To: pgsql-sql@postgreSQL.org
Subject: Join with blank records.
Date: Wed, 28 Jul 1999 14:05:34 -0400
Message-ID: <4.1.19990728134746.03f6c4d0@mail.venux.net> (raw)

Greetings,

I have two tables, one is customers and one is their phones.  Something
simple like this:

customer
cust_id int4
cust_name varchar(30)

phone
cust_id int4
number varchar(15)


select c.*, p.number from customer and c, phone as p
where c.cust_name='smith'
and p.cust_id = c.cust_id;

The problem I am having with this is that only records in the customer
table that have matching records in the phone number table are showing up.
What I would really like is for all records that match the first criteria
to show up regardless if they have matching phone number records.

Any insight would be greatly appreciated.

Thank you,
Matthew Hagerty



view thread (3+ messages)  latest in thread

Message-ID: <4.1.19990728134746.03f6c4d0@mail.venux.net>
Permalink:  ../4.1.19990728134746.03f6c4d0@mail.venux.net/
Also on:    postgresql.org/message-id/4.1.19990728134746.03f6c4d0@mail.venux.net

 · 

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: matthew@venux.net
  Subject: Re: Join with blank records.
  In-Reply-To: <4.1.19990728134746.03f6c4d0@mail.venux.net>
  References: <4.1.19990728134746.03f6c4d0@mail.venux.net>

* 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