Home » Other » Client Tools » Difference in precision in sqlplus and excel
Difference in precision in sqlplus and excel [message #412237] Wed, 08 July 2009 06:01 Go to next message
loveoracle
Messages: 41
Registered: February 2006
Location: Mumbai
Member

Dear All,

In sqlplus i am getting following output. But when I check sum in Excel then I am getting difference in precesion.
Is there any reason for same.

SQL Plus output:

	SUM(A)  B  	    C D
------------- --- ----------- -
    161168899 BSE   200910060 C
   83641194.3 BSE   200910060 D
   11420845.9 BSE   200910060 C
   7272839.37 BSE   200910060 D
    763331488 NSE     2009117 C
    483849377 NSE     2009117 D
   6918785.78 NSE     2009117 C
   7049142.56 NSE     2009117 D
 
Excel Output 
	     A	B	   	C	D
-------------- --       ----------     -----
161168899.21	B	200910060	C
83641194.33	B	200910060	D
11420845.9	B	200910060	C
7272839.37	B	200910060	D
763331488.35	N	2009117		C
483849377.36	N	2009117		D
6918785.78	N	2009117		C
7049142.56	N	2009117		D

Thanks in advance.

Re: Difference in precision in sqlplus and excel [message #412248 is a reply to message #412237] Wed, 08 July 2009 06:29 Go to previous messageGo to next message
Michel Cadot
Messages: 68644
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
set numwidth ...

Excel and SQL*Plus can let you specify the precision.
You set them differently.

Regards
Michel
Re: Difference in precision in sqlplus and excel [message #412250 is a reply to message #412237] Wed, 08 July 2009 06:30 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
These are sums of different data, or different processing is taking place.
Neither Excel nor Sqlplus remove decimal places on a whim, so something different is happening that you've not shown us.
Re: Difference in precision in sqlplus and excel [message #412274 is a reply to message #412237] Wed, 08 July 2009 07:46 Go to previous messageGo to next message
loveoracle
Messages: 41
Registered: February 2006
Location: Mumbai
Member


Hi,

I am just taking sum of data with group by caluse in sqlplus.
And in excel I am taking indivisual values and computing sum.

Regards.
Re: Difference in precision in sqlplus and excel [message #412279 is a reply to message #412237] Wed, 08 July 2009 08:03 Go to previous messageGo to next message
loveoracle
Messages: 41
Registered: February 2006
Location: Mumbai
Member

Hi All,

If I run same query in command window of PL/SQL developer tool
then I am getting out same as excel.
	     A	B	   	C	D
-------------- --       ----------     -----
161168899.21	B	200910060	C
83641194.33	B	200910060	D
11420845.9	B	200910060	C
7272839.37	B	200910060	D
763331488.35	N	2009117		C
483849377.36	N	2009117		D
6918785.78	N	2009117		C
7049142.56	N	2009117		D

In sqlplus it's not showing me the precisions for some values.

Regards.

[EDITED by LF: applied [pre] tags]

[Updated on: Wed, 08 July 2009 10:31] by Moderator

Report message to a moderator

Re: Difference in precision in sqlplus and excel [message #412281 is a reply to message #412279] Wed, 08 July 2009 08:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68644
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Did you read my answer and applied what I said?

Regards
Michel
Re: Difference in precision in sqlplus and excel [message #412298 is a reply to message #412279] Wed, 08 July 2009 09:50 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Your SQL*Plus results are all showing 9 significant figures.
I suspect that you've defined the column with FORMAT 999999999
Previous Topic: empty explain pane in TOAD and SQLDeveloper
Next Topic: cannot see the view scripts in schema browser
Goto Forum:
  


Current Time: Wed Apr 24 01:11:33 CDT 2024