Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle equalivent of a Sybase's ISQL for Select Into Trick
On Dec 15, 4:05 pm, Edmond <somewh..._at_yahoo.com> wrote:
> Hi,
>
> In Sybase,
>
> I can do select * into new_table from old_table where 1=0;
>
> This will create the empty new_table which the column name and data
> definition the same as the old_table.
>
> Is there a equivalent trick in Oracle to do so?
>
> Thanks,
>
create table foo
as select * from bar
where 0=1
/
Frankly the Sybase 'solution' is a kludge as it misuses SELECT to impost for CREATE TABLE.
-- Sybrand Bakker Senior Oracle DBAReceived on Fri Dec 15 2006 - 09:09:13 CST
> Edmond