sql add row number code example
Example 1: create row number in sql
SELECT t.A, t.B, t.C, ROW_NUMBER() OVER (ORDER BY t.A) as newId
FROM dbo.tableZ AS t
ORDER BY t.A;
Example 2: tsql row number
SELECT
ROW_NUMBER() OVER (
ORDER BY first_name
) row_num,
first_name,
last_name,
city
FROM
sales.customers;
Example 3: sql command to add row to table
INSERT INTO table(column1, column2,...)
VALUES (value1, value2,...);