case, new column not found - Mailing list pgsql-sql

From Martín Marqués
Subject case, new column not found
Date
Msg-id 01062120022108.16528@bugs
Whole thread Raw
Responses Re: case, new column not found
Re: case, new column not found
Re: case, new column not found
List pgsql-sql
I'm trying somethings here and I get strange errors:

select *,((CASE WHEN titulo LIKE '%Matematica%' THEN 1 ELSE 0 END) + (CASE WHEN descripcion LIKE '%Matematica%' THEN 1
ELSE0 END) +(CASE WHEN incumbencia LIKE '%Matematica%' THEN 1 ELSE 0 END) ) 
 
AS encontrados 
FROM admin_view 
WHERE admin_view.nivel=1 AND encontrados > 0;

ERROR:  Attribute 'encontrados' not found

Why is it? encontrados should be an attribute of type INT with the count of 
the rows found.

Any ideas?

Saludos... :-)

-- 
Cualquiera administra un NT.
Ese es el problema, que cualquiera administre.
-----------------------------------------------------------------
Martin Marques                  |        mmarques@unl.edu.ar
Programador, Administrador      |       Centro de Telematica                      Universidad Nacional
        del Litoral
 
-----------------------------------------------------------------


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Changing PL/pgSQL triggers
Next
From: Stephan Szabo
Date:
Subject: Re: case, new column not found