分类: 数据库开发技术
2015-06-30 11:33:32
create table with1 ( id int, name char(10));
create table with2 ( id int, name char(10));
create table with3 ( id int, name char(10));
create table with4 ( id int, name char(10));
insert into with1 values ( 1, 'a') ;
insert into with2 values ( 1, 'a') ;
insert into with3 values ( 1, 'a') ;
insert into with4 values ( 1, 'a') ;
select * from _V_SYSTEM_INFO ;
--Release 7.2.0.3-P2 [Build 43166]
[nz@hlixau1105 ~]$ nzrev -rev
7.0.2.12-P1-F1-Bld37340
[nz@hlixau1105 ~]$
with temp1 ( id , name) as (select id , name from with1 ),
temp2 ( id , name) as ( select with2.id ,with2.name from with2 , temp1 where with2.id = temp1.id),
temp3 ( id , name) as ( select with3.id ,with3.name from with3 , temp2 where with3.id = temp2.id)
select temp3.id, temp3.name from temp2 , temp3 , with4 where temp3.id = temp2.id and with4.id=temp3.id ;
id name
---------------------
1 a
it works from Version 7 .