本文共 900 字,大约阅读时间需要 3 分钟。
/*DDL Information For - test.user*/ ----------------------------------- Table Create Table ------ ------------------------------------------------------- user CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` char(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 |
insert into `user`(username) values(@var1:='csdn_user1'); select cast(@var1 as char(20)) ; |
cast(@var1 as char(20))csdn_user2
select username from `user` where id = last_insert_id(); |
usernamecsdn_user1
update `user` set username = (@var1:='csdn_user2'); |
select cast(@var1 as char(20)) ; |
cast(@var1 as char(20))csdn_user2
本文转自 david_yeung 51CTO博客,原文链接:http://blog.51cto.com/yueliangdao0608/81401,如需转载请自行联系原作者