MySQL查询结果条数编号的方法并不复杂,下面就以实例的形式为您介绍MySQL查询结果条数编号实现过程,我们先来了解一下MySQL查询结果条数编号的语句写法:
- SELECT @row := @row + 1 as row, t.*
- FROM some_table t, (SELECT @row := 0) r
实例:
- SELECT @row := @row +1 AS
- ROW , t.pro_name, t.place
- FROM mp_product t, (
- SELECT @row :=0
- )r
【编辑推荐】