Re: How to convert rows into HTML columns?

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: How to convert rows into HTML columns?
Дата
Msg-id 6D36D064-897D-4E0A-A55B-57DCAEFA95CB@seespotcode.net
обсуждение исходный текст
Ответ на How to convert rows into HTML columns?  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список pgsql-general
On Oct 5, 2007, at 1:20 , Stefan Schwarzer wrote:

> Before I was used that the yearly values were all to be found in a
> single SQL row; now for each year of each country I have a separate
> row. How do I convert that into a single (HTML) row again?

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

> And the next question coming up is: How should my query look like
> so that I can sort the (HTML) table by a specific year in ascending
> or descending order? So, that it doesn't display it by the country
> names alphabetical order, but by, say 1998?

Same way you would otherwise -- ORDER BY -- after using crosstab.

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: Stefan Schwarzer
Дата:
Сообщение: Re: Find min year and min value
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Find min year and min value