1.准备
1.1 脚本
create table tb4(id int,v1 int);
insert into tb4(id,v1) values(1,11);
insert into tb4(id,v1) values(2,12);
select * from tb4
1.2 运行结果
2.简单应用
2.1 脚本
with temptb4 as (select * from tb4)
select * from temptb4
2.2 运行结果
1.1 脚本
create table tb4(id int,v1 int);
insert into tb4(id,v1) values(1,11);
insert into tb4(id,v1) values(2,12);
select * from tb4
1.2 运行结果
2.1 脚本
with temptb4 as (select * from tb4)
select * from temptb4
2.2 运行结果