当前位置:   article > 正文

mysql 行号查询

mysql查行号

1

  1. SET @row_number = 0;
  2. SELECT
  3. (@row_number:=@row_number + 1) AS num, firstName, lastName
  4. FROM
  5. employees
  6. LIMIT 5;

2

  1. SELECT
  2. (@row_number:=@row_number + 1) AS num, firstName, lastName
  3. FROM
  4. employees,(SELECT @row_number:=0) AS t
  5. LIMIT 5;

转载于:https://my.oschina.net/u/3238650/blog/3023312

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/672510
推荐阅读
相关标签
  

闽ICP备14008679号