Re: Pls Hlp: SQL Problem - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Pls Hlp: SQL Problem
Date
Msg-id dcc563d10809121304p3d7de469sa381a5fa9a6194a7@mail.gmail.com
Whole thread Raw
In response to Re: Pls Hlp: SQL Problem  (Hengky Lie <hengkyliwandouw@gmail.com>)
Responses Re: Pls Hlp: SQL Problem
List pgsql-sql
On Fri, Sep 12, 2008 at 12:50 PM, Hengky Lie <hengkyliwandouw@gmail.com> wrote:
> Dear Richard,
>
> Sorry for that :) and thanks for your tips, but it didn't solve my problem.
> Maybe because my postgresql knowledge limitation. I have tried your
> suggestion, my view like this :

Put parens around the whole thing, like:

(tbltransaksi.hargapokok * tbltransaksi.keluar)::numeric(2,0) AS modal

Otherwise you're really doing this:

tbltransaksi.hargapokok::numeric * tbltransaksi.keluar::numeric(2,0) AS modal

and when you multiply a numeric times a numeric(2,0) you get a
numeric, not a numeric(2,0)


pgsql-sql by date:

Previous
From: Hengky Lie
Date:
Subject: Re: Pls Hlp: SQL Problem
Next
From: "Scott Marlowe"
Date:
Subject: Re: Doubts about FK