If the Id is a field in the table then:
Select Id, Name from table_name
If you mean that you want a row number in the result and the row number is defined based on the order of names then the query would look something like:
select row_number() over (order by name) as id, Name from table_name