Re: [GENERAL] How do you live without OUTER joins?

From: Herbert Liechti <Herbert(dot)Liechti(at)thinx(dot)ch>
To: Bruce Bantos <anon(at)mgfairfax(dot)rr(dot)com>, postgres <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] How do you live without OUTER joins?
Date: 2000-01-12 07:54:33
Message-ID: 387C3339.86CA7717@thinx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Liechti(at)thinx(dot)ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adriaan Joubert 2000-01-12 08:10:46 Re: [GENERAL] constant column value in view with union
Previous Message Peter Eisentraut 2000-01-12 03:58:53 Re: [GENERAL] PSQL Function() help....