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.