标签:http color 使用 ar 数据 div 代码 html sp
1
2
|
INSERT INTO 目标表 SELECT * FROM 来源表; insert into insertTest select * from insertTest2; |
1
2
|
INSERT INTO 目标表 (字段1, 字段2, ...) SELECT 字段1, 字段2, ... FROM 来源表;(这里的话字段必须保持一致) insert into insertTest2(id) select id from insertTest2; |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
INSERT INTO 目标表 (字段1, 字段2, ...) SELECT 字段1, 字段2, ... FROM 来源表 WHERE not exists ( select * from 目标表 where 目标表.比较字段 = 来源表.比较字段); 1>.插入多条记录: insert into insertTest2 (id, name ) select id, name from insertTest where not exists ( select * from insertTest2 where insertTest2.id=insertTest.id); 2>.插入一条记录: insert into insertTest (id, name ) SELECT 100, ‘liudehua‘ FROM dual WHERE not exists ( select * from insertTest where insertTest.id = 100); |
原文:http://www.2cto.com/database/201307/226259.html
标签:http color 使用 ar 数据 div 代码 html sp
原文地址:http://www.cnblogs.com/davidwang456/p/3945583.html