How to add row seq. number in "select" ?

suppose I have a table and I want to include a row sequence number"row_num" for each row in “select” query, for example,open xdesc select row_num: i , sym, open, high, low, close from tb;close xdesc select row_num: i, sym, open, high, low, close from tb;above code not work as I want, for “i” is fixed as the order of recordinsert into the table.So, how to do ?

Order the table prior to selecting the index

select row_num: i , sym, open, high, low, close from `open xdesc tb

“i” is fixed as the order of record?insert into the table.

update i from select ..?


Aaron Davies
aaron.davies@gmail.com