首页 > 代码库 > sql的其他语句

sql的其他语句

***insert***

insert into table_name (Stock_name,Stock_number) value ("xxx","xxxx") 

insert into table_name (Stock_name,Stock_number) value (select Stockname , Stocknumber from Stock_table2) 

 

***update***

update table_name set Stockname = "xxx" [where Stockid = 3]

 

 

***delete***

delete from table_name where Stockid = 3

truncate table_name ----------- 删除表中所有行,仍保持表的完整性
drop table table_name --------------- 完全删除表

 

***alter table*** --- 修改数据库表结构

alter table database.owner.table_name   add   column_name char(2) null .....

 

sql的其他语句