Format an Update with calculation

From: Bret Stern <bret_stern(at)machinemanagement(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Format an Update with calculation
Date: 2018-12-18 07:14:57
Message-ID: 1545117297.4397.18.camel@dell990-bret-centos.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My statement below updates the pricing no problem, but I want it to be
formatted with 2 dec points eg (43.23).

Started playing with to_numeric but can't figure it out. Lots of
examples with to_char in the
manual, but still searching for answer.

Can it be done?

I want suggested_retail_price to be formatted to 2 decimal points

UPDATE im_ci_item_transfer
SET suggested_retail_price=(suggested_retail_price +
(suggested_retail_price * .13))
WHERE item_code='0025881P2';

Feeling lazy, sorry guys

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2018-12-18 07:18:13 Re: Format an Update with calculation
Previous Message Pavel Stehule 2018-12-18 06:40:32 Re: IF NOT EXIST