mysql 查找结果中自动加序号列

来源:互联网 发布:linux ioctlsocket 编辑:程序博客网 时间:2024/06/05 15:21

select (@rowNO := @rowNo+1) AS rowno, a.id, a.img_url from test a, (select @rowNO :=0) b;

查找mysql 数据库 自动 添加 序号 字段列1,2,3,4..........

就像这样。。




查询语句:

select (@rowNO := @rowNo+1) AS rowno, a.id, a.img_url from 表名 a, (select @rowNO :=0) b;

原创粉丝点击