Sql Select statement with auto generated row id

By
Advertisement

I would like to create a select query statement with autonumber.. like..

select Id,Name from myTable

will give me everything from table.
The result I'd like to get is..
1         data1
2         data2
3         data3

So i have used the below query

SELECT ROW_NUMBER() OVER (ORDER BY Name) , * FROM myTable

0 comments:

Post a Comment

Online Casino