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!