SQL to output line number in results of a query

后端 未结 5 531
忘了有多久
忘了有多久 2021-01-07 17:38

I would like to generate a line number for each line in the results of a sql query. How is it possible to do that?

Example: In the request

select di         


        
5条回答
  •  醉酒成梦
    2021-01-07 18:11

    In SQL we are also using this query:

    select row_number() over (order by table_kid) as S_No ,table_columnname,table_columnname2 from tablename where table_fieldcondition='condtionnal falg or data ';
    

    Here table_kid or may be other table_columnname

提交回复
热议问题