-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathROUND function in SQL.txt
More file actions
12 lines (12 loc) · 1.01 KB
/
ROUND function in SQL.txt
File metadata and controls
12 lines (12 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
// Round function
ROUND(column_name,decimal) -> function is used to round a numeric field to the number of decimals specified.
ex: select * , ROUND(fees,1) from student_reg;
+------+---------+---------+------------+-----------+------+--------+-------+---------------+
| s_id | name | address | dob | fees | id | result | marks | ROUND(fees,1) |
+------+---------+---------+------------+-----------+------+--------+-------+---------------+
| 101 | RAM | KTM | 1998-12-15 | 100000.23 | 1001 | SECOND | 300 | 100000.2 |
| 102 | SITA | KTM | 2001-10-11 | 200000.12 | NULL | SECOND | 400 | 200000.1 |
| 103 | HARI | PKR | 2001-01-12 | 10000.52 | NULL | FIRST | 450 | 10000.5 |
| 104 | BIMAl | KTM | NULL | 100200.00 | NULL | THIRD | 250 | 100200.0 |
| 106 | SITA KC | PKR | 1998-02-02 | 20000.12 | NULL | SECOND | 340 | 20000.1 |
+------+---------+---------+------------+-----------+------+--------+-------+---------------+