Ever needed to return a set of data from SQL with index? One way of doing this is by the use of incremental counters, but one thing I've used was "Row_Number . Here's how to use it.
Select Row_Number () over (order by ID) AS Row, Column1, Column2, from EmployeeThis query will give you an extra row with the name "Row" which will now serve as your index.
Hope this helps. Happy Coding!!
No comments:
Post a Comment