select @i:=@i+1 as n,A.* 
from test1 A,(SELECT @i:=0) B