Re: Pls Hlp: SQL Problem

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Pls Hlp: SQL Problem
Дата
Msg-id 48CA432A.1050501@archonet.com
обсуждение исходный текст
Ответ на Pls Hlp: SQL Problem  (Hengky Lie <hengkyliwandouw@gmail.com>)
Ответы Re: Pls Hlp: SQL Problem  (Hengky Lie <hengkyliwandouw@gmail.com>)
Список 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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Hengky Lie
Дата:
Сообщение: Pls Hlp: SQL Problem
Следующее
От: "Ruben Gouveia"
Дата:
Сообщение: Re: DIfference between max() and greatest() ?