Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I do a Select Into
Shawn Francis wrote:
>
> Very simple question. How do select data out of one table and put the
> results into another table.
>
> Example:
>
> Select MedicalRecordNumber, count(*) into newTableName
> From existingTableName
>
> According to the manuals I have I can only do this into variables. Is this
> true?
Hi Shawn Francis
If newTableName exists then use
INSERT INTO newTableName(col1, col2) SELECT MedicalRecordNumber, count(*) FROM existingTableName
else use
CREATE TABLE newTableName(col1, col2) AS SELECT MedicalRecordNumber, count(*) FROM existingTableName
Regards
Konstantin V. Sartakov Kuzbassprombank Kemerovo Russia mailto:skv_at_kpbank.ruReceived on Thu Apr 17 1997 - 00:00:00 CDT
![]() |
![]() |