查询时类似Oracle Rownum的效果
SELECT @rowno:=@rowno+1 as rowno,r.* from table_name r ,(select @rowno:=0) t;
快速创建表
下面这条语句可以快速创建包含查询结果的表
create table table_name as select xxx…
联表更新
update t_news a
set a.order_num = (select rowno from t_news_1 b
where
b.news_id = a.news_id)