December 30 2015

mysql获取rownum

mysql> insert into t(id) sELECT @rownum:=@rownum+1 rownum from (SELECT @rownum:=0 from information_schema.tables  limit 100) tt;

Query OK, 100 rows affected (0.02 sec)

Records: 100  Duplicates: 0  Warnings: 0

mysql> commit;

Query OK, 0 rows affected (0.00 sec)

 



Copyright 2019. All rights reserved.

Posted 2015年12月30日 by ucjmh in category "mysql

Leave a Reply

Your email address will not be published. Required fields are marked *