select (@i:=@i+1) i_index,user_name from user, (select @i:=0) as i;