AD

Oracle.Mysql.SqlServer insert multiple data

(1) Oracle in:
insert into product
(Id, names, price, code)
select 100, 'a', 1,1 from dual
union
select 101, 'b', 2,2 from dual;
Here is best to use an insert, otherwise efficiency is not high, with multiple select.

(2) Mysql in:
insert into table (id, name)
values ​​(1, 'A'), (2, 'B'), (3, 'C')

(3) SqlServer in:

INSERT
INTO table_name (col_one, col_two)
SELECT 'col1', 'col2'
UNION
SELECT 'col11', 'col22'

SELECT *
FROM table_name;

GO

UNION should not be spared (if province, just insert (col1, col2));
标签: oracle, efficiency, table id, product id, insert into table
分类: Database
时间: 2011-03-17

相关文章

  1. Oracle database to insert date-type data

    Oracle database to insert date-type data (to_date usage) Today, Oracle database encountered the need to insert ...
  2. oracle,mysql,SqlServer三种数据库的分页查询的实例

    oracle,mysql,SqlServer三种数据库的分页查询的实例,需要的朋友可以参考一下 MySql: MySQL数据库实现分页比较简单,提供了 LIMIT函数.一般只需要直接写到sql语句后面就行了. LIMIT ...
  3. oracle.mysql.sqlserver out of 10 random data

    - Oracle out of 10 random data SELECT * FROM ( SELECT * FROM acc_nbr ORDER BY trunc (dbms_random.value (1,11)) ...
  4. Oracle / Mysql / SqlServer function difference

    1. Type conversions --Oracle select to_number('123') from dual; --123; select to_char(33) from dual; --33; sel ...
  5. oracle insert multiple data cycle

    insert into test select 491061 + rownum, '0 '| | (100 + rownum), round (dbms_random.value (600001,999999 )),'' ...
  6. oracle.mysql.sqlserver reserved words

    Oralce keywords Oracle sql query keywords select * from v$reserved_words ACCESS ADD ALL ALTER AND ANY AS ASC A ...
  7. Oracle,Mysql,Sqlserver数据库连接串(总爱忘,留着备用)

    首先选择合适自己数据库的驱动程序,这里提到的都是常用驱动. 连接Oracle数据库 获得Oracle的驱动程序包classes12.jar 把Oracle的驱动程序到\WEB-INF\lib下 Class.forName ...
  8. sqlserver Insert Date data type problem

    Today to be a Date data type insert, from the java.util.Date type conversion success, and found database only ...
  9. Recommend a good use of the oracle, mysql, sqlserver table structure of the software to export to word

    Usually sometimes written documents, often encounter such a situation, such as database structure design is go ...
  10. Recommend a good use of oracle, mysql, sqlserver table structure of the software to export to word

    Usually sometimes written documents, often encounter such a situation, such as database structure designed in ...
  11. 推荐一款很好用的oracle,mysql,sqlserver表结构导出到word的软件

    平时有时写文档,往往会遇到这样的情况,比如数据库表结构设计好,在数据库中加了 注释后,想导出到WORD,EXCEL文档,今天终于发现有个不错的工具可以实现, 实现其实是利用OFFICE 的VBA宏去实现的,实现的时候要启 ...
  12. A sql insert multiple data

    insert into tb_user(id,username) values (null,'test1'),(null,'test2'); -- And so on .
  13. An SQL insert multiple data

    INSERT INTO NT_RECHARGEDETAIL (RECHARGEBATCHID, CARDNO, ACCOUNTID, AMT) SELECT 100000000035, '8881234223300000 ...
  14. oracle database insert date-type data

    Wrote oracle database to insert date-type data into the Oracle database date-type data (to_date usage) Met the ...
  15. MySql SqlServer Oracle the difference between the three?

    Comparison of MySQL and SQLServer For program developers, the current background using the two most popular My ...
  16. MySql SqlServer Oracle the difference between the three? (Change)

    For program developers, the current background using the two most popular MySQL database and shall SQLServer. ...
  17. Walk around turn mysql, sqlserver, oracle database, three kinds of large object access

    Original mysql, sqlserver, oracle three kinds of database access to large objects collection mysql large objec ...
  18. [Transfer] Oracle.DB2.SQLSERVER.Mysql.Access page sort SQL statements

    http://www.blogjava.net/fanyingjie/archive/2010/09/28/333108.html Oracle, DB2, SQLSERVER, Mysql, Access paging ...
  19. Oracle how to insert special characters: & and '(multiple solutions) (rpm)

    Oracle how to insert special characters: & and '(multiple solutions) Today, a number of importing data to ...