http://www.postgresql.org/docs/current/static/tablefunc.html

select * from crosstab(
> 'select year, month, qty from sales order by 1',
> 'select m from generate_series(1,12) m'
> ) as (
> year int,
> "Jan" int,
> "Feb" int,
> "Mar" int,
> "Apr" int,
> "May" int,
> "Jun" int,
> "Jul" int,
> "Aug" int,
> "Sep" int,
> "Oct" int,
> "Nov" int,
> "Dec" int
> );
>
Eu gostaria de algo assim:

select * from alguma_funcao(
  'select year, month, qty from sales order by 1',
  'select m from generate_series(1,12) m',
  'select nome_mes from calendario order by 1');

Isso existe?

-- 
Atenciosamente,
Alexsander da Rosa
http://rednaxel.com
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a