Slightly OT: outer joins

From: Fran Fabrizio <ffabrizio(at)mmrd(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Slightly OT: outer joins
Date: 2001-11-20 15:29:35
Message-ID: 3BFA76DF.3DF40B3C@mmrd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


This is a little off topic but this is the best source of SQL knowledge
I know about so hopefully this will be interesting enough for someone to
answer. :-)

I've got the following tables:

Table people
id fname lname
1 bob smith
2 tom jones
3 jane doe
4 mike porter

Table food
id favorite_food
2 eggrolls
3 ice cream

Table color
id color
1 red
3 blue

I want a query to produce the result set:

fname lname favorite_color favorite_food
bob smith red null
tom jones null eggrolls
jane doe blue ice cream
mike porter null null

I'm having lots of trouble getting the right result or knowing whether
this is even a valid usage of outer joins. Can somebody show me a
working query? Thanks!

-Fran

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2001-11-20 15:40:03 Re: print out custom functions
Previous Message Alexander Wallace 2001-11-20 15:28:30 Migrating from MSSql...