Problema con clausula OVER

From: Luz María García Reyna <garciareyna_l(at)hotmail(dot)com>
To: "pgsql-es-ayuda(at)postgresql(dot)org" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Problema con clausula OVER
Date: 2014-02-06 19:45:10
Message-ID: SNT151-W3323CC376F0A9C56BBE41182940@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola!

Un usuario tiene el siguiente select el cual puede ejecutalo satisfactoriamente en un servidor virtual Linux con PostgreSQL 8.4.0:

SELECT
row_number() OVER (ORDER BY suma) registro,

case

when


total_mzas_finiquitadas is null then 0 else total_mzas_finiquitadas

end

+

case

when

total_mzas_pen_ini
is null then 0 else total_mzas_pen_ini

end

+

case

when

total_mzas_pen_fin
is null then 0 else total_mzas_pen_fin

end

+

case

when

total_mzas_proceso
is null then 0 else total_mzas_proceso

end

+

case

when

total_mzas_vacias
is null then 0 else total_mzas_vacias

end

as suma FROM eco_2014.censor_avance where
ce||substring(cvepadre,1,4)='260310' order by suma

Peeero, al ejecutar la misma consulta en:- Un servidor virtual Linux con PostgreSQL 9.2.4- Un servidor windows con PostgreSQL 9.2.4

marca el error siguiente:

ERROR: column
"suma" does not exist

LINE 1: SELECT row_number() OVER
(ORDER BY suma) registro,


^

********** Error **********

ERROR: column "suma" does not exist

SQL state: 42703

Character: 36

Alguna idea?

Gracias y saludos!

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Lazaro Ruben Garcia Martinez 2014-02-06 20:59:18 Sobre barman 1.3
Previous Message Pedro PG 2014-02-06 15:50:34 RE: Personalizar SQLERRM