`
openxtiger
  • 浏览: 153168 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

mysql产生行号

 
阅读更多

mysql产生行号:

set @n = 0;
update tbl_material_stone a, (select stone_id,@n:=@n+1  r from tbl_material_stone order by stone_id) b  set no = r where a.stone_id =b.stone_id;

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics