Rounding Numbers Up and Down in SQL Server Using CEILING and FLOOR
Автор: Coding With Brett
Загружено: 2022-03-08
Просмотров: 687
Here's a quick video to show you how to round a number up or down in SQL Server.
00:09 - Basic rounding
00:31 - Rounding up or down
Rounding numbers in SQL Server is easy. Use the ROUND function if you want a particular number of decimal places, CEILING rounds up to the nearest whole number and FLOOR rounds down to the nearest whole number. Here's an example:
SELECT UnitPrice, ROUND(UnitPrice, 0) AS 'Rounded Price',
CEILING(UnitPrice) AS 'Rounded Up Price',
FLOOR(UnitPrice) AS 'Rounded Down Price'
FROM [AdventureWorks].[Purchasing].[PurchaseOrderDetail]
If you found this video leave a LIKE and SUBSCRIBE for more coding videos.
Check out my SQL Programming playlist for more tutorials: • SQL Programming
Stock footage credits: https://www.pexels.com/@tima-miroshni... and https://www.pexels.com/@mrcolo-12653218
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: