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

From: "Alain TESIO" <tesio(at)easynet(dot)fr>
To: "Bruce Bantos" <anon(at)mgfairfax(dot)rr(dot)com>, <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] How do you live without OUTER joins?
Date: 2000-01-12 01:09:10
Message-ID: 002401bf5c99$e35344a0$f05f72c3@atesio
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It's maybe not the best solution, what I usually is :

- Copy the lines you want from company into a temporary
table tmp, with "com_cat_long" added with the right type,
initialized with NULL
- Update this column in tmp from company_category
- Select from tmp
- Drop tmp

Or maybe :

select company_name,com_cat_long from company,company_category where ...
union
select company_name,NULL as com_cat_long from company where
com_cat_abbr=NULL

I'm not sure about the syntax for the second one, sorry I can't try it now.

Alain

> For example, how can I live without outer joins in the example below:
>
> In my current Oracle DB, I have a number of "lookup" tables that contain
> something like this:
>
> TABLE company_category:
>
> com_cat_abbr | com_cat_long
> --------------------------------------------------
> SB | Small Business
> LB | Large Business
> NP | Not for Profit
>
> etc.
>
> Then in my main table, lets say the "company" table I have:
>
> company_name | com_cat_abbr
> ------------------------------------------------------------
> Microsoft | LB
> United Way | NP
> Coca Cola | NULL
>
> What are my alternatives? What is everyone else doing in their Postgres
> system? Thanks.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-01-12 01:47:25 Re: [GENERAL] Where is my database gone ?
Previous Message Bruce Bantos 2000-01-12 00:36:24 How do you live without OUTER joins?