【发布时间】:2016-07-13 21:01:21
【问题描述】:
我有一张桌子。我想在它上面选择一个可以用作各种索引的列。
我有这张桌子,table1:
col 1 col2 col3
a b c
d e f
g h i
我想做:
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;
得到
seq col 1 col2 col3
1 a b c
2 d e f
3 g h i
我一直在谷歌搜索,似乎找不到任何有用的东西。抱歉,我也是 MySQL 初学者。
【问题讨论】: