还别说,这个问题最好的方法就是作业,建立一个作业,每5分钟执行一次以下存储过程:create proc pr_co班级
as
set nocount on--增加班级
insert classtable(班级,...)
select distinct 班级,... from studentinfo a where not exists (
select 1 from classtable where 班级=a.班级)--删除班级
delete a
from classtable a
where not exists (
select 1 from studentinfo where 班级=a.班级)go
as
set nocount on--增加班级
insert classtable(班级,...)
select distinct 班级,... from studentinfo a where not exists (
select 1 from classtable where 班级=a.班级)--删除班级
delete a
from classtable a
where not exists (
select 1 from studentinfo where 班级=a.班级)go
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货