SELECT @o:=@o+1 as col, * FROM table ,(SELECT @o:=0) r;
SELECT @1:=@1+1 as col, * FROM table ,(SELECT @1:=0) r;
SELECT @:=@+1 as col, * FROM table ,(SELECT @:=0) r;
执行后 查询结果会多出一列 col
SELECT @o:=@o+1 as col, * FROM table ,(SELECT @o:=0) r;
SELECT @1:=@1+1 as col, * FROM table ,(SELECT @1:=0) r;
SELECT @:=@+1 as col, * FROM table ,(SELECT @:=0) r;
执行后 查询结果会多出一列 col
评论 (0)