Loading

怎么在SQL查询的结果里加行号?

怎么在SQL查询的结果里加行号?

学习了:https://zhidao.baidu.com/question/91188037.html

 

mysql :
Select a.*,(@rowNum:=@rowNum+1) as rowNo
From a,
 (Select (@rowNum :=0) ) b
oracle :
select a.*,rownum from a
sql server :
select row_number()over(order by XX)as RowNum,* from a

 

posted @ 2018-05-10 20:19  stono  阅读(181)  评论(0编辑  收藏  举报