SQL平时练习.docVIP

  • 4
  • 0
  • 约1.86千字
  • 约 4页
  • 2018-06-26 发布于河南
  • 举报
SQL平时练习

--通过查询插入新表内容(整个表插入) select * into 仓库备份 from 仓库 go select * into 职工备份 from 职工 --通过查询插入新表内容(部分列插入) select 仓库ID,仓库号,城市,面积 into 仓库第二次备份 from 仓库 --通过指定部分列插入记录 insert into 仓库备份(仓库号)values(wh7) select * from 仓库备份 order by 仓库ID delete from 仓库备份 where 城市 is null; --通过默认值插入记录 insert into 仓库 default values select * from 仓库 --插入多行记录 insert into 职工备份(职工号,仓库号,姓名,性别,工资) values(zg101,wh2,李平,女,1560), (zg102,wh2,张亮,男,2160), (zg103,wh3,周科,女,1850) --查看上一条结果:select * from 职工备份order by 职工ID --利用Union All插入多行数据记录 insert into 职工备份(职工号,仓库号,姓名,性别,工资) select zg201,wh1,王可平,女,1560 uni

文档评论(0)

1亿VIP精品文档

相关文档