Question

I have create a table in redshift database, such like

CREATE TABLE abc (
   "field1"              decimal(8,3)
)

Then I try to run the following SQL

insert into abc ("field1") values (666.666);

But finally I just found the value in the table become 666.66

Please help.

Was it helpful?

Solution

I finally got the answer.

I am using Workbench for the SQL client, and it default show 2 decimal place only. I have to change it inside the options setting.

OTHER TIPS

To change the default of just two decimal digits, change the SQLWorkbench's data formatting. This can be achieved by

Preferences -> Data Formatting -> Decimal digits -> to 3 (based on the above example). 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top