Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
How to make auto numbering ( row number ) in mysql query
SUBMITTED BY:
Guest
DATE:
Aug. 10, 2014, 2:50 a.m.
FORMAT:
Text only
SIZE:
423 Bytes
Raw
Download
Tweet
HITS:
3268
Go to comments
Report
How to make auto numbering ( row number ) in mysql query
##for example
tb_1
================
name | sell | bonus
aa | 2 | 4
bb | 2 | 1
cc | 2 | 1
##the query
select @i:=@i+1 as no,name,sell,bonus from tb_1 join (select @i:=0) order by name
##the result
no | name | sell | bonus
1 | aa | 2 | 4
2 | bb | 2 | 1
3 | cc | 2 | 1
go and try... see you
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus