1 、从学生表中删除未报到学生表中数据
1)学生基本信息表xsjbxxb,未报到学生表lsb_50
2)pl/sql中创建一个临时表(as select * from xsjbxxb where 1=2,临时表结构与xxjbxxb一致)
create table lsb_50 as select * from xsjbxxb where 1=2
3)创建好后,查询该表,确保表中无数据
select * from lsb_50
4)从excel中导入数据,提交进数据库commit
5)查询2018级新生数据(改动前)
select * from xsjbxxb where dqszj='2018'
6)联合查询,从 xsjbxxb表中挑出未报到的学生( xsjbxxb表中和未报到的学生表lsb_50学号一致的数据),为删除数据做准备,查询结果和lsb_50一致,操作正确
select * from xsjbxxb where xh in (select lsb_50.xh from lsb_50 )
7)从xsjbxxb表中删除未报到学生数据
delete from xsjbxxb where xh in (select lsb_50.xh from lsb_50 )
8)commit提交操作进数据库
9)查询验证
select * from xsjbxxb where dqszj='2018'