filmov
tv
Learn how to Round numbers in oracle SQL, [ ROUND TRUNC MOD functions ] [SQL Tutorial]

Показать описание
Learn how to use the ROUND , TRUNC and MOD function in oracle sql.
ROUND function is used when you need to round decimal number to the closest one.
ROUND Examples:
SELECT ROUND(45.923,2), ROUND(45.923,0),
ROUND(45.923,-1)
FROM DUAL;
TRUNC function is required when you need to remove part of the decimals without rounding it.
TRUNC Exampl:
SELECT TRUNC(45.923,2), TRUNC(45.923),
TRUNC(45.923,-2)
FROM DUAL;
MOD function is used to calculate the remainder number.
The MOD function is often used to determine if a value is odd or even.
MOD Example:
SELECT MOD(5 ,2 ),
MOD(1600 , 300 )
FROM DUAL;
Another MOD Example:
SELECT last_name, salary, MOD(salary, 5000)
FROM employees
WHERE job_id = 'SA_REP';
Chapters:
00:00 Intro
00:17 ROUND function.
02:59 TRUNC function.
04:52 MOD function.
05:52 MOD example more explanation.
06:57 Example 2 MOD function.
✅ Oracle database download link:
✅ To install sample database on you database, please check this video:
✅ website:
✅ How to become oracle expert Article:
ROUND function is used when you need to round decimal number to the closest one.
ROUND Examples:
SELECT ROUND(45.923,2), ROUND(45.923,0),
ROUND(45.923,-1)
FROM DUAL;
TRUNC function is required when you need to remove part of the decimals without rounding it.
TRUNC Exampl:
SELECT TRUNC(45.923,2), TRUNC(45.923),
TRUNC(45.923,-2)
FROM DUAL;
MOD function is used to calculate the remainder number.
The MOD function is often used to determine if a value is odd or even.
MOD Example:
SELECT MOD(5 ,2 ),
MOD(1600 , 300 )
FROM DUAL;
Another MOD Example:
SELECT last_name, salary, MOD(salary, 5000)
FROM employees
WHERE job_id = 'SA_REP';
Chapters:
00:00 Intro
00:17 ROUND function.
02:59 TRUNC function.
04:52 MOD function.
05:52 MOD example more explanation.
06:57 Example 2 MOD function.
✅ Oracle database download link:
✅ To install sample database on you database, please check this video:
✅ website:
✅ How to become oracle expert Article: