We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I try to run select round(v, 2) from test_round;, I want to get Float number result, but the return type is Number(0,0).
select round(v, 2) from test_round;
Number(0,0) will be parsed as Integer because the scale is 0.
test_round v 1.111 2.222 3.333
The text was updated successfully, but these errors were encountered:
It is a documentation bug.
I should emphasize that when the precision is zero, the scale is ignored and type is NUMBER without precision and scale.
NUMBER
Look at the following. The data type of round(v, 2) is NUMBER.
round(v, 2)
SQL> create table test_round (v number(3, 2)); Table created. SQL> desc test_round Name Null? Type ----------------------------------------- -------- ---------------------------- V NUMBER(3,2) SQL> insert into test_round values (1.111); 1 row created. SQL> select round(v, 2) from test_round; ROUND(V,2) ---------- 1.11 SQL> create table test_round_result as select round(v, 2) as rounded_v from test_round; Table created. SQL> desc test_round_result Name Null? Type ----------------------------------------- -------- ---------------------------- ROUNDED_V NUMBER
Sorry, something went wrong.
No branches or pull requests
When I try to run
select round(v, 2) from test_round;
, I want to get Float number result, but the return type is Number(0,0).Number(0,0) will be parsed as Integer because the scale is 0.
test_round
v
1.111
2.222
3.333
The text was updated successfully, but these errors were encountered: