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