Re: what's wrong in this procedure? - Mailing list pgsql-sql

From Rob Sargent
Subject Re: what's wrong in this procedure?
Date
Msg-id 4D6821A0.7030202@gmail.com
Whole thread Raw
In response to what's wrong in this procedure?  (Camaleon <tarsis.lima@gmail.com>)
List pgsql-sql

On 02/25/2011 10:46 AM, Camaleon wrote:
> This error is returned Erro de SQL:
> 
> ERROR:  column "Aguardando Pagto" does not exist at character 352  >>>
> 
> 
> create or replace function get_historico()   RETURNS SETOF twiste.type_cur__historico AS '
> 
>    SELECT o.data_fim, sum(t.num_itens * t.valor) AS total, count(t.*) AS transacoes
>    FROM ofertas o
>    JOIN transacao t ON o.ofertas_id = t.ofertas_id
>    JOIN municipio m ON o.municipio_id = m.municipio_id
>   WHERE  o.data_fim <= now() AND t.status IN("Aguardando Pagto", "Em análise", "Aprovado", "Completo")
>   GROUP BY o.data_fim;
> '
> language 'sql';
> 
> 
> 
>>> the column is t.status and not "Aguardando Pagto";
>>> what's wrong ?  thanks
> 

Single quotes (') not double quotes (")


pgsql-sql by date:

Previous
From: Vibhor Kumar
Date:
Subject: Re: Problem with serial counters
Next
From: Vibhor Kumar
Date:
Subject: Re: what's wrong in this procedure?