Looking for correct SQL

Поиск
Список
Период
Сортировка
От Alexander Pucher
Тема Looking for correct SQL
Дата
Msg-id 416ED799.4020809@atlas.gis.univie.ac.at
обсуждение исходный текст
Ответы Re: Looking for correct SQL  (Michael Fuhr <mike@fuhr.org>)
Список 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.

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Keith Worthington"
Дата:
Сообщение: copy error
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: copy error