case, new column not found

Поиск
Список
Период
Сортировка
Искать
От
Martín Marqués
Тема
case, new column not found
Дата
Msg-id
01062120022108.16528@bugs
Список
Дерево обсуждения
case, new column not found Martín Marqués <martin@bugs.unl.edu.ar>
Re: case, new column not found Tom Lane <tgl@sss.pgh.pa.us>
Re: case, new column not found Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: case, new column not found "Josh Berkus" <josh@agliodbs.com>
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 ELSE 0 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 по дате отправления
От: Josh Berkus
Дата:
Сообщение: Re: Changing PL/pgSQL triggers
От: Stephan Szabo
Дата:
Сообщение: Re: case, new column not found
FAQ