sql line numbers code example
Example 1: sql row number
SELECT
ROW_NUMBER() OVER(PARTITION BY recovery_model_desc ORDER BY name ASC)
AS Row#,
name, recovery_model_desc
FROM sys.databases WHERE database_id < 5;
Example 2: SQL rounding numbers
SELECT 2.555555; --> Result 2.555555
SELECT ROUND(2.555555); --> Result 3
SELECT ROUND(2.555555, 3); --> Result 2.556
SELECT ROUND(2.555555, 0); --> Result 3