I'm writing a snowflake query that calculate 1/2940744 and get the result equals to 0 How to solve to get the actual calculation result?
CodePudding user response:
select 1::float/2940744
CodePudding user response:
From docs:
The value
0.00000034005
was rounded to 0. In order to change the behaviour one of the arguments could be explicitly casted:SELECT 1::NUMBER(38,12)/2940744; -- 0.00000034005 DESC RESULT LAST_QUERY_ID(); -- 1::NUMBER(38,12)/2940744 NUMBER(38,12)