SQL CEIL: Round Up Numbers with Decimals
In SQL, you can use the CEIL function to round up and preserve decimal places. The syntax of the CEIL function is as follows:
CEIL(number)
In this case, the number is the number that needs to be rounded up. For example, if we want to round up and keep 2 decimal places, you can use the following statement:
SELECT CEIL(number * 100) / 100
In this example, we multiply the number by 100 first, then use the CEIL function to round the result up, and finally divide by 100 to keep two decimal places.