How to use the MySQL ROUND function

The MySQL ROUND function returns a number rounded to a certain number of decimal places.

SQL ROUND() Syntax

SELECT ROUND(column_name,decimals) FROM table_name;

Examples

SELECT ROUND(totalamount,0) AS RoundedPrice
FROM PurchaseMas;

Round lower

select floor(debit) from transactiontable where debit<100 and Debit<>0

Round upper

select  ceil(debit) from transactiontable where debit<100 and Debit<>0

Post a Comment

0 Comments