Re: Looking for correct SQL

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Looking for correct SQL
Дата
Msg-id 20041014200221.GA96446@winnie.fuhr.org
обсуждение исходный текст
Ответ на Looking for correct SQL  (Alexander Pucher <pucher@atlas.gis.univie.ac.at>)
Список pgsql-novice
On Thu, Oct 14, 2004 at 09:46:33PM +0200, Alexander Pucher wrote:
>
> 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

Take a look at the crosstab functions in contrib/tablefunc.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: copy error
Следующее
От: "Adam I. Harris, M.D."
Дата:
Сообщение: Getting Started