Re: sql join question

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Scott Frankel <leknarf(at)pacbell(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: sql join question
Date: 2005-03-01 22:28:16
Message-ID: 1109716096.16688.86.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-03-01 at 13:42 -0800, Scott Frankel wrote:

> [snip problem]

> Task: find all color names in each of palette1's tones.
>
> Can this be done in a single SQL statement?

> [snip table examples]

looks like a job for NATURAL JOIN

test=# select color_name
from palettes
natural join tones
natural join colors
where palette_name='plt1';

color_name
----------------
rose madder
crimson
red ochre
phthalocyanine
leaf green
(5 rows)

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Kratz 2005-03-01 22:38:42 Re: Novice Question
Previous Message CSN 2005-03-01 22:17:53 Trigger email?