From: Robson Martins <robson-martins@bol.com.br>
To: pgsql-admin@postgresql.org
Subject: Divide Date with interger
Date: Fri, 14 Jun 2002 11:39:23 -0300
Message-ID: <000a01c213b1$689f3a80$3a3c620a@catnet.com.br> (raw)
As to divide one i number int number with date
Exemplo:
> Select Max(RazaoSocial) As mRazaoSocial, Max(Endereco) As mEndereco, Max(Bairro) As mBairro, Max(Cidade) As mCidade, Max(CEP) As mCEP, Max(UF) As mUF, ('(' || Max(DDD) || ') ' || Max(Fone1)) As mFone, Max(Data) As mData, Sum(Qtde) As mQtde, DescCor As mCor FROM Movimento, Clientes, Cores WHERE Movimento.CGC = Clientes.CGCCli And Clientes.TipoCli = 'N' And Clientes.CodCli > 1 And (Clientes.Class = 'A' Or Clientes.Class = 'B' Or Clientes.Class = 'C') And Movimento.CodCor = Cores.CodCor And Movimento.Data >=(current_date-(30*4)) And Movimento.CodProduto = '2491' And Clientes.UF = 'SP' Group By CGCCli, DescCor Order By (Sum(Qtde) / (current_date + 1 -Max(Data))) Desc
Error: ERROR: Unable to identify an operator '/' for types 'numeric' and 'interval'
You will have to retype this query using an explicit cast
Regards.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: robson-martins@bol.com.br
Subject: Re: Divide Date with interger
In-Reply-To: <000a01c213b1$689f3a80$3a3c620a@catnet.com.br>
References: <000a01c213b1$689f3a80$3a3c620a@catnet.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox