select

(@i:=@i+1)   as   i,

table1.*

from

table1 , (select   @i:=0)  temp