Here is my SQL statement to do query:
If I would like to add serial number for each record as bellowing, how to do it?
We can make good use of ROW_NUMBER function.
ROW_NUMBERis an analytic function. It assigns a unique number to each row to which it is applied (either each row in the partition or each row returned by the query), in the ordered sequence of rows specified in the
, beginning with 1.
The SQL statement had been revised as following: