SELECT Row_Number() Over (Order By <column_name>) as SNO, <table_name>.*
FROM <table_name>
This query will list all records of a table with a serial number column at start, the Row_Number() function does the trick for us, it requires one column for sorting.
Result:
SNO | ... |
---|---|
1 | ... |
2 | ... |
3 | ... |
4 | ... |
. | ... |
. | ... |
. | ... |
. | ... |
. | ... |
No comments:
Post a Comment