mssql mysql oracle 临时表demo

1、mssql 临时表
drop table #temp;
select bid into #temp FROM sign.sign WHERE no='3503221';
delete from student WHERE bid IN (SELECT * FROM #temp);
delete from score WHERE bid IN (SELECT * FROM #temp);
delete from examine WHERE bid IN (SELECT * FROM #temp);


2、mysql临时表
create temporary table tmp_student select sid from student where cid=158105;
update class set a_status=1 WHERE sid in ( select * from tmp_student );
update score set b_status=1 where sid in ( select * from tmp_student ); 


3、oracle 临时表

猜你喜欢

转载自franciswmf.iteye.com/blog/2362221