Looking for correct SQL

From: Alexander Pucher <pucher(at)atlas(dot)gis(dot)univie(dot)ac(dot)at>
To: pgsql-novice(at)postgresql(dot)org
Subject: Looking for correct SQL
Date: 2004-10-14 19:46:33
Message-ID: 416ED799.4020809@atlas.gis.univie.ac.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I'm struggling for some time with the following problem:

I have a table like this:

name key value
-------------------------
andi age 23
andi hometown boston
tom age 45
greg hometown miami

I would like to get the following through a SQL Select Statement:

name age hometown
-------------------------
andy 23 boston
tom 45 NULL
greg NULL miami

I thought about a subselect, but could'nt find the clue.

Thanks for any input,
best regards,
alex.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2004-10-14 19:46:47 Re: copy error
Previous Message Keith Worthington 2004-10-14 18:12:49 copy error