mysql如何把查询到的数据加上一个自动编号字段

发布于 分类 Mysql 来源 原文链接

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

就像这样。。

select (@rowNO := @rowNo+1) AS rowno,zhuanfaContent,content,sendDate,sendTime,zhuanfaAuthor,zhuanfaLink from (SELECT zhuanfaContent,content,sendDate,sendTime,zhuanfaAuthor,zhuanfaLink FROM t_toefldata_zhuanfa where sendDate = '2012-04-21') a,(select @rowNO :=0) b

-- The End --

本文标题: mysql如何把查询到的数据加上一个自动编号字段

本文地址: https://seonoco.com/blog/mysql-how-to-add-the-query-to-an-auto-id-field

原文地址: http://blog.csdn.net/macwhirr123/article/details/7489484

本页面显示内容已针对移动端进行优化,点击查看完整版本