查询并批量插入数据的Sql命令
INSERT INTO student(id,xuesheng,yuwen,shuxue,yingyu) SELECT id,xuesheng,yuwen,shuxue,yingyu FROM stu;
实践:
insert into store_advertisings(id,title,PicListJson,edittime)
(select s.Id,s.`Name` as name , ‘[]‘,NOW() from stores s left join store_advertisings d on s.Id= d.Id where d.Id is null)
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/16012.html
- 上一篇:《Java知识应用》Java读写DBF文件
- 下一篇:centos 安装多实例数据库