美文网首页
201109:insert语句批量插入-string去掉最后一个

201109:insert语句批量插入-string去掉最后一个

作者: 弹钢琴的崽崽 | 来源:发表于2020-11-09 20:59 被阅读0次

一. insert语句插入多条记录

Mysql数据库

insert into persons (id_p, lastname , firstName, city )values(200,'haha' , 'deng' , 'shenzhen'),(201,'haha2' , 'deng' , 'GD'),(202,'haha3' , 'deng' , 'Beijing');

Oracle数据库

insert all 
    into Student(id, name, sex, age, tel) values ('12', 'jack1', '男', 12, '13345674567' )
    into Student(id, name, sex, age, tel) values ('13', 'jack2', '男', 13, '13345674567')
    select * from dual;

二. string去掉最后一个字符

String str4 = "1,2,3,6,7,";
str4 = str4.substring(0, str4.length() -1);

相关文章

网友评论

      本文标题:201109:insert语句批量插入-string去掉最后一个

      本文链接:https://www.haomeiwen.com/subject/qqprbktx.html