这是条不归路

呜呜呜~

导航

SQL 关于临时表

--#代表局部临时表,##代表全局临时表
--1.创建临时表
--方法一
create table #临时表名(字段1 约束条件,字段2 约束条件,.....)
create table ##临时表名(字段1 约束条件,字段2 约束条件,.....)
--方法二(推荐:简单方便):
select * into #临时表名 from 你的表;
select * into ##临时表名 from 你的表;

--2.删除临时表
drop table #临时表名;
drop table ##临时表名;

--3.查询
Select * from #临时表名;
Select * from ##临时表名;

 

posted on 2023-06-06 18:06  En'  阅读(39)  评论(0编辑  收藏  举报