方法1:

insert into `ttt`
select '001','语文' union all
select '002','数学' union all
select '003','英语';

方法2:

INSERT INTO tab_comp VALUES(item1, price1, qty1),
(item2, price2, qty2),
(item3, price3, qty3);

方法3:

 INSERT INTO tab_comp(item1, price1, qty1) SELECT item1, price1, qty1 FROM tab_cc;

insert into table 插入多条数据的更多相关文章

  1. insert一句话实现插入一条数据并且返回这条数据的某列

    insert into [table] output inserted.columnName values();

  2. MySql LAST_INSERT_ID 【插入多条数据时】

    LAST_INSERT_ID 自动返回最后一个 INSERT 或 UPDATE 操作为 AUTO_INCREMENT 列设置的第一个发生的值. 参考这里 The ID that was generat ...

  3. 数据库一次性插入10w条数据,怎么插入效率快

    在SQL Server 中插入一条数据使用Insert语句,但是如果想要批量插入一堆数据的话,循环使用Insert不仅效率低,而且会导致SQL一系统性能问题 下面介绍SQL Server支持的两种批量 ...

  4. sql每五秒插入一条数据 一次插入N条数据

    1建立数据表 create table projectManage ( ID int identity primary key not null, projectName )not null, man ...

  5. MySQL往表里插入千条数据 存储过程

    工作中遇到的问题,先记录一下,方便以后查看 存在两张表,user表和friend表 user表部分字段,如上图 friend表部分字段,如上图 往friend表插入千条数据,friend表中的user ...

  6. oracle使用一条语句批量插入多条数据

    例如我有一个test表 create table (stuid int,name varchar(20); 插入多条数据,注意不能直接使用insert into test values(1,'a'), ...

  7. Oracle 一条sql插入多条数据

    Oracle一次插入多条数据. 表结构: create table aa ( ID NUMBER(11) PRIMARY KEY, NAME VARCHAR2(20) ) 第一种方式: insert ...

  8. Oracle-创建新表,创建备份表,对表中插入多条数据

    一.创建新表 0.基本语法 create table 表名称(id varchar2(50) primary key ,name char(200) not null,phone number(11) ...

  9. mysql一次插入多条数据

    mysql一次插入多条数据: INSERT INTO hk_test(username, passwd) VALUES ('qmf2', 'qmf2'),('qmf3', 'qmf3'),('qmf4 ...

随机推荐

  1. Tensorflow 笔记

    TensorFlow笔记-08-过拟合,正则化,matplotlib 区分红蓝点 TensorFlow笔记-07-神经网络优化-学习率,滑动平均 TensorFlow笔记-06-神经网络优化-损失函数 ...

  2. php-cgi和php-fpm,Windows环境下解决Nginx+php并发访问阻塞问题。

    php-cgi 是运行php,php-fpm是守护php-cgi进程 nginx配置目录运行php        location  ~ \.php$        {                 ...

  3. Zabbix-2.4-安装-4

    Zabbix api 对于以上两种方式,有些人都不选,倾向于使用第三种:使用zabbix api加上这个监控在把这台机器删除了,然后discovery和自动注册的都关闭了再换一种方式把它加进去,zab ...

  4. nginx支持android、ios、微信扫一扫

    首先做一个android下载的html页面,页面中识别微信浏览器提示在浏览器中打开,然后在nginx对ios进行识别并跳转到apple store #下载App location ^~ /appDow ...

  5. ueditor图片上传和显示问题

    图片上传: 这段是contorller代码 @RequestMapping(value = "/uploadImg", method = RequestMethod.POST) @ ...

  6. golang里处理xml文件 转自https://studygolang.com/articles/5328

    <?xml version="1.0" encoding="utf-8"?> <servers version="1"&g ...

  7. delphi Int64Rec 应用实例

    以下代码可以看到 Int64Rec <--> Int64 procedure TForm1.Button2Click(Sender: TObject); var ii1,ii2,ii3:I ...

  8. 测试教程网.unittest教程.5. 实例: 找出所有是弱密码的用户

    From: http://www.testclass.net/pyunit/test_example_3/ 背景 当我们的测试数据是下面这些的时候,我们的用例是有问题的. [ {"name& ...

  9. Netty Tutorial Part 1: Introduction to Netty [z]

    Netty Tutorial, Part 1: Introduction to Netty Update:  Part 1.5 Has Been Published: Netty Tutorial P ...

  10. uoj#213. 【UNR #1】争夺圣杯

    http://uoj.ac/problem/209 单调栈求出每个位置x左边第一个大于它的位置L[x]和右第一个不小于它的位置R[x],于是矩形L[x]<=l<=x<=r<=R ...