PRB IN ROUND FUNCTION
2 posters
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
PRB IN ROUND FUNCTION
i got
SQL> select PHONE_NO,ROUND(PHONE_NO/100,0) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,0)
---------- ---------------------
9046491272 90464913
SQL> select PHONE_NO,ROUND(PHONE_NO/100,1) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,1)
---------- ---------------------
9046491272 90464912.7
SQL> select PHONE_NO,ROUND(PHONE_NO/100,2) FROM CUSTOMER_336474;
SQL> select PHONE_NO,ROUND(PHONE_NO/10000,2) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/10000,2)
---------- -----------------------
9046491272 904649.13
why is the precession not working properly?? for select PHONE_NO,ROUND(PHONE_NO/100,2) FROM CUSTOMER_336474;
the output should have been 90464912.72 !! y is this prob caused???
SQL> select PHONE_NO,ROUND(PHONE_NO/100,0) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,0)
---------- ---------------------
9046491272 90464913
SQL> select PHONE_NO,ROUND(PHONE_NO/100,1) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,1)
---------- ---------------------
9046491272 90464912.7
SQL> select PHONE_NO,ROUND(PHONE_NO/100,2) FROM CUSTOMER_336474;
SQL> select PHONE_NO,ROUND(PHONE_NO/10000,2) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/10000,2)
---------- -----------------------
9046491272 904649.13
why is the precession not working properly?? for select PHONE_NO,ROUND(PHONE_NO/100,2) FROM CUSTOMER_336474;
the output should have been 90464912.72 !! y is this prob caused???
Re: PRB IN ROUND FUNCTION
hey when i tried through the browser link they gave it shows
PHONE_NO ROUND(PHONE_NO/10000,4)
9046491272 904649.127
for both
select PHONE_NO,ROUND(PHONE_NO/10000,4) FROM CUSTOMER_336474;
and
select PHONE_NO,ROUND(PHONE_NO/10000,3) FROM CUSTOMER_336474;
y is it so???
PHONE_NO ROUND(PHONE_NO/10000,4)
9046491272 904649.127
for both
select PHONE_NO,ROUND(PHONE_NO/10000,4) FROM CUSTOMER_336474;
and
select PHONE_NO,ROUND(PHONE_NO/10000,3) FROM CUSTOMER_336474;
y is it so???
Re: PRB IN ROUND FUNCTION
I think the function of round will be wasted in that example....
select ROUND(9046491276/10,1)from dual;
select ROUND(9046491276/100,2)from dual;
select ROUND(9046491276/1000,3)from dual;
select ROUND(9046491276/10000,4)from dual;
select ROUND(9046491276/100000,5)from dual;
case:
No of Zeros == precision value
All the ABOVE will give one precision less than mentioned.. i Think that it is for, some round functionality has to be done.Otherwise No point in using round funtion in above cases....... May be.. I am not sure.
select ROUND(9046491276/10,1)from dual;
select ROUND(9046491276/100,2)from dual;
select ROUND(9046491276/1000,3)from dual;
select ROUND(9046491276/10000,4)from dual;
select ROUND(9046491276/100000,5)from dual;
case:
No of Zeros == precision value
All the ABOVE will give one precision less than mentioned.. i Think that it is for, some round functionality has to be done.Otherwise No point in using round funtion in above cases....... May be.. I am not sure.
Mahee- Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia
Re: PRB IN ROUND FUNCTION
no in
SQL> select PHONE_NO,ROUND(PHONE_NO/100,1) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,1)
---------- ---------------------
9046491272 90464912.7
i got the correct precision as i mentioned~
SQL> select PHONE_NO,ROUND(PHONE_NO/100,1) FROM CUSTOMER_336474;
PHONE_NO ROUND(PHONE_NO/100,1)
---------- ---------------------
9046491272 90464912.7
i got the correct precision as i mentioned~
Re: PRB IN ROUND FUNCTION
yea it will....
I said it will occur ly for cases where the denominator is (10 * x) and the precision given is x...
According to ur view,
9046491272/100 = 90464912.72
and
ROUND(9046491272/100,2)=90464912.72
The answer for the above two were same, so there is no point in using round...
I said it will occur ly for cases where the denominator is (10 * x) and the precision given is x...
According to ur view,
9046491272/100 = 90464912.72
and
ROUND(9046491272/100,2)=90464912.72
The answer for the above two were same, so there is no point in using round...
Mahee- Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|