Re: Pls Hlp: SQL Problem

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Hengky Lie" <hengkyliwandouw(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Pls Hlp: SQL Problem
Date: 2008-09-12 20:04:58
Message-ID: dcc563d10809121304p3d7de469sa381a5fa9a6194a7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Sep 12, 2008 at 12:50 PM, Hengky Lie <hengkyliwandouw(at)gmail(dot)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)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2008-09-12 20:07:53 Re: Doubts about FK
Previous Message Hengky Lie 2008-09-12 18:50:46 Re: Pls Hlp: SQL Problem