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

Re: Pls Hlp: SQL Problem

From: Richard Huxton <dev(at)archonet(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 10:23:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hengky Lie wrote:
> Dear friends,

Hello. Quick tip - don't reply to another message when starting a new
thread, people will assume it's part of the old thread.

[snip most of query]
> / 100::numeric * 

> Food";3960.0000;*4200.000000000000000000000000*;*240.000000000000000000000000*

> Why  the calculation result has so many decimals ?

Because you've cast 100 to numeric, rather than numeric(10,2) or
whatever. This means you get the full accuracy on the calculation - it
won't ever trim a numeric (that's the whole reason to have the type).

  Richard Huxton
  Archonet Ltd

In response to


pgsql-sql by date

Next:From: Ruben GouveiaDate: 2008-09-12 16:47:39
Subject: Re: DIfference between max() and greatest() ?
Previous:From: Hengky LieDate: 2008-09-12 09:22:51
Subject: Pls Hlp: SQL Problem

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