Date: Tue, 28 Aug 2007 02:09:01 -0400
Reply-To: Dimitri Shvorob <dimitri.shvorob@VANDERBILT.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dimitri Shvorob <dimitri.shvorob@VANDERBILT.EDU>
Subject: Re: CREATE TABLE recursively references the target table
Chang, you got it, thanks! (The example is all the more intriguing as
create table a as
select *
from (select age from a);
(I replaced 'select 14 as age' with 'select age') runs OK.
Also thanks to Paul and Howard! To answer Paul's (implicit) question,
I cannot see why creating a table using a recursive reference to its
former self would be necessary. If the goal is to update a master file,
other instruments are better suited for the purpose.
I use recursive CREATE TABLE to add columns to existing tables
create table a as
select *, 14 as age
from a;
(age could also come from a different table).
Admittedly, ADD COLUMN .. UPDATE would be more efficient.