不同数据库之间的语法差异还真不少~要崩溃了。
1.创建带自增列临时表:create TEMPORARY table t(id int AUTO_INCREMENT PRIMARY key, u_name varchar(50));--为什么必须要主键?!
向这个临时表中插入数据:insert into t values(null, 'zdy');--为什么一定要加null?!
2.把一张表的查询结果插入临时表:insert into t(u_name) select u_name from user where u_type = '系统用户';
3.declare语句要写在存储过程中...
4.while do ... end while 语句必须写在存储过程中...