| From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: what's wrong in this procedure? |
| Date: | 2011-02-25 18:33:57 |
| Message-ID: | 4D67F615.5060909@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On 02/25/2011 09: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
>
Try single quotes, 'Aguardando Pagto'
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Yeb Havinga | 2011-02-25 18:38:52 | Re: what's wrong in this procedure? |
| Previous Message | Camaleon | 2011-02-25 17:46:57 | what's wrong in this procedure? |