I have a table. I would like to select onto it a column that can serve as an index of sorts.
I have this table, table1
:
col 1 col2 col3
a b c
d e f
g h i
I'd like to do:
CREATE TEMPORARY TABLE temp1 AS
SELECT (some way to create a sequence from 1 to the height of the table) AS `seq`
,col1
,col2
,col3
FROM table1;
and get
seq col 1 col2 col3
1 a b c
2 d e f
3 g h i
I've been googling around and can't seem to come across anything useful. Sorry, I'm also a beginner at MySQL.