Home » SQL & PL/SQL » SQL & PL/SQL » Different result in Oracle and SQL server
icon9.gif  Different result in Oracle and SQL server [message #205477] Sat, 25 November 2006 02:05 Go to next message
loveoracle
Messages: 41
Registered: February 2006
Location: Mumbai
Member

Dear All,

I have 2 DB. One is in oracle and another is in sql server 2005.
Both have same tables and records.
Problem is that,
I have one view. The script is same in Oracle and SQL server 2005.
But for One calculation i am getting different values.

calculation is:

(CAST(FLOOR(((COALESCE(Factor, 0.0) * TerrRate) * POWER(10.0, 4)) + 0.5 ) as float) / POWER(10.0, 4)) * 100 

o/p of sql server is;
---------------------
4.4600
0.8600
0.8000

and o/p of Oracle is;
-----------------------
4.47
0.86
0.8

why I am getting the 0.01 difference???
The values for  factor and terrrate is same in both DB.
factor = 
-------
0.0084
0.009
0.047

and terrrate =
-------------
0.95
0.95
0.95


Please sone one help me. I am in confusion...
Thanks in advance.
Re: Different result in Oracle and SQL server [message #205548 is a reply to message #205477] Sat, 25 November 2006 18:52 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I don't know why,but SQL Server seems to be getting the wrong answer (having just run through the calculations by hand).
It must be getting the rounding wrong somewhere.

Can you get them both to print out the intermediate steps of the caclulations and see where they differ?
Previous Topic: ORA-1779 Update of a view with more than one table
Next Topic: about Indexes,help me
Goto Forum:
  


Current Time: Wed Dec 07 16:49:43 CST 2016

Total time taken to generate the page: 0.07597 seconds