Sunday, November 24, 2013

Difference between Ceiling, Floor and Round in SQL Server

SQL Server rounding functions-Ceiling, Floor and Round

In SQL queries sometimes we need to round off some decimal  or float values, at that time we always think that which option to be applied while we have three different kinds of system defined SQL rounding functions-Ceiling, Floor and Round.

CEILING
Get the value on the right side of the decimal and returns the smallest integer greater or equal to, the specified values.

FLOOR
Get the value on the right side of the decimal and returns the largest integer less or equal to the specified values (only number)

ROUND
Rounds a positive or negative value to a specific length.

Example of SQL rounding functions


Difference between Ceiling, Floor and Round in SQL Server

0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Code Imagine