In my sql, if I write the following code,
`SELECT *, @i:=@i+1 AS index FROM table`, I could get an auto\_increment index column, starting from 1.

I just want to understand the rationale behind this query. Why select statement here can be functioning like a "Loop" to loop through all rows?

Cheers