语法

INSERT INTO 表 VALUES (值1, 值2,....)   

也可以指定要插入数据的

INSERT INTO表(列1, 列2,...) VALUES (值1, 值2,....)

 

例:插入新的行

"Persons" 表:

LastName

FirstName

Address

City

Carter

Thomas

Changan Street

Beijing

SQL 语句:

INSERT INTO Persons VALUES ('Gates', 'Bill', 'Xuanwumen 10', 'Beijing')

结果:

LastName

FirstName

Address

City

Carter

Thomas

Changan Street

Beijing

Gates

Bill

Xuanwumen 10

Beijing

例:在指定的列中插入数据

"Persons" 表:

LastName

FirstName

Address

City

Carter

Thomas

Changan Street

Beijing

Gates

Bill

Xuanwumen 10

Beijing

SQL 语句:

INSERT INTO Persons (LastName, Address) VALUES ('Wilson', 'Champs-Elysees')

结果:

LastName

FirstName

Address

City

Carter

Thomas

Changan Street

Beijing

Gates

Bill

Xuanwumen 10

Beijing

Wilson

 

Champs-Elysees

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
相关资源
相似解决方案