문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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). 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top