Re: [GENERAL] How do you live without OUTER joins? - Mailing list pgsql-general

From Herbert Liechti
Subject Re: [GENERAL] How do you live without OUTER joins?
Date
Msg-id 387C3339.86CA7717@thinx.ch
Whole thread Raw
In response to Re: [GENERAL] How do you live without OUTER joins?  (admin <admin@wtbwts.com>)
List pgsql-general
Bruce Bantos wrote:
>
> > I'm not sure if this is what you're looking for, but you can try:
> > select company_category.com_cat_long, company.company_name from
> > company_category, company where
> > company_category.com_cat_abbr=company.com_cat_abbr;
>
> A simple join like that will inlcude only the company records with a
> com_cat_abbr equal to an entry in the company_category table. You would not
> get all the records in the company table. In the example below, you would
> only get records for Microsoft and the United Way...the Coca Cola entry
> would not be included in the query. Thus the need for outer joins....

You may solve the problem with a union select by selecting the joined
records in the first statement and the remaining records in the second
statement.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti                     E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services        Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pgsql-general by date:

Previous
From: root
Date:
Subject: (no subject)
Next
From: Adriaan Joubert
Date:
Subject: Re: [GENERAL] constant column value in view with union