插入数据
insert into mytable (id,name,age) values (1,xxiang,23)
从别的表中数据插入到mytable中
insert into my(id,name,age)
select id,name,age from othertable
从别的表中数据插入到新的表中,新表未创建(就是数据库中没有这个表)
select Id,name,age
insert into newtabel
from mytable
更新数据
update mytable set name='xxiang2007' where age=24 //有条件
update mytable set name='xxiang2007' //无条件,就是全部的数据
update mytable set name='xxiang2004' from newtable where id=10 //也可以用from从别的表写条件
删除数据
delete from mytable where name='xxiang2007' //有条件
delete from mytable //无条件,就是全部的数据
truncate table mytable //删除全部数据
delete from mytable from newtable where id =10 //也可以用from从别的表写条件,如两个表的关系了