Re: Decimal ??

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Decimal ??
Дата
Msg-id 5820.959143470@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Decimal ??  (Tubagus Nizomi <nizomi@dnet.net.id>)
Список pgsql-sql
Tubagus Nizomi <nizomi@dnet.net.id> writes:
> I have table :
> create table test (name text, price numeric(6,2));
> but when i insert into test values ('John',3/4);
> why this value 0.00 but i want to 0.75 ??? help me please.

Offhand I'd bet that "3/4" is being interpreted as an integer
division expression.  Try "3.0/4.0" or some such if you want
a fractional result...
        regards, tom lane


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

Предыдущее
От: Jason Earl
Дата:
Сообщение: Re: Decimal ??
Следующее
От: Michael Ma
Дата:
Сообщение: Unable to identify a right operator '>=' for type 'bpchar'