Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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


pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group