视图是用来把一些比较复杂的查询作成预定义方式,以后用起来方便
create view as select * from tb1 where ...
临时表一般用在存储过程里,用来临时存放数据用的,好处是方便,用完后自动删除,也可以加快存储过程的速度
create procedure proc_1
as
begin
create table #tmp (id char(10)...)
insert into #tmp ...
delete from #tmp...
select * from #tmp
end
如此这般