Why it is recommended to avoid referencing a floating point column in the where clause?



Why it is recommended to avoid referencing a floating point column in the where clause?..

Answer / Surendra Singh Laspal

It is recommended to avoid referencing a floating point column in the WHERE clause because of precision and rounding errors. SQL Server stores floating-point numbers as binary values, which can lead to unexpected results when performing equality comparisons due to rounding differences. To mitigate this issue, it's best to compare floating-point columns using ranges or approximate functions like `FLOOR` and `CEILING`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are cursors and when they are useful?

1 Answers  


Can another user execute your local temporary stored procedures?

1 Answers  


what are different types of backups available in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

1 Answers  


Explain about temporary stored procedure?

1 Answers  


Which sql server table is used to hold the stored procedure script?

1 Answers  


what is the difference between delete,drop and truncate

2 Answers   Honeywell, Zomato,


What is difference between unique and primary key?

1 Answers  


What is truncate table?

1 Answers  


How to generate the Reports for the Database? I need an Example for it.Will we manually do this or else any script is there? Please let me know ASAP...

1 Answers   Cognizant,


How to convert binary strings into integers in ms sql server?

1 Answers  


What are the new data types are introduced in sql 2000?

1 Answers  


How to get the count of distinct records. Please give me the query?

8 Answers   Value Labs,


Categories