SQL语句用法大全-增删改

1.新增:insert into

insert into table

(name,class,score)

values(“Leo”,“一班”,888)

若插入多行数据则为:

values

(1,1,1),

(2,2,2),

(3,3,3)

或使用

insert into table(name,sex)

select “aaa”,“女”  union

select “bbb”,“女”

2.更改:update

update table set name=“Lover”

where id =001

3.删除:delete

delete from table where name=“aaa”

合并查询结果:查询栏目需一致union

select name,number from a

union

select name,number from b

你可能感兴趣的:(SQL语句用法大全-增删改)