Rows to columns

Поиск
Список
Период
Сортировка
От Josué Maldonado
Тема Rows to columns
Дата
Msg-id 403B9BC3.3070506@lamundial.hn
обсуждение исходный текст
Ответы Re: Rows to columns  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
Hello List,


I have a table that look like this:

create table estad
(nprodfk int, cmes char(6), hmes char(5),
nqty numeric(12,2), nsold numeric(12,5),
ncost numeric(12,2));

It contains this data:

insert into estad
values (25,'200402','FEB04',500,5000,2300);

insert into estad
values (25,'200401','ENE04',700,6200,2900);

insert into estad
values (25,'200312','DIC03',950,7100,3000);

insert into estad
values (25,'200311','NOV03',360,3900,1760);

insert into estad
values (25,'200310','OCT03',490,4600,1850);


The problem is I need show the data in this way:

TIPO    OCT03    NOV03    DIC03    ENE04    FEB04
--------------------------------------------------------
NQTY     490     360     950     700     500
NSOLD    4600    3900    7100    6200    5000
NCOST    1850    1760    3000    2900    2300

Any idea or suggestion?

Thanks in advanced.


--

Josué Maldonado




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

Предыдущее
От: Sean Shanny
Дата:
Сообщение: Re: Found this in the server log on MAC OSX
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Rows to columns