Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/05/2011, 23:51
elninon
 
Fecha de Ingreso: mayo-2011
Mensajes: 2
Antigüedad: 13 años
Puntos: 0
Información Respuesta: Consulta sobre Query Dinamico

Bueno, pude resolverlo utilizando crosstab, de la siguiente manera:
Código MySQL:
Ver original
  1. SELECT * FROM crosstab
  2. (
  3. 'select id, order, value from test ORDER BY 1',
  4. 'select distinct order from test ORDER BY 1'
  5. )
  6. (
  7.     id numeric(20),
  8.     value1 text,
  9.     value2 text,
  10.     value3 text
  11. );

De aca saque la info para poder aplicarlo:
[URL="http://www.postgresql.org/docs/current/interactive/tablefunc.html"]http://www.postgresql.org/docs/current/interactive/tablefunc.html[/URL]

Saludos!