Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Crea una nuova tabella selezionando dati provenienti da altre tabelle con creare tabella come
By using SQL data manipulation statement, a new, temporary, backup or regular table can be created and filled or inserted with data from another table or tables retrieved by SELECT statement. Mediante la manipolazione dei dati di SQL dichiarazione, un nuovo, temporaneo, di backup o di regolare tabella possono essere creati e riempiti o con i dati inseriti da un altro o più tabelle Estratto da SELECT. The SQL data manipulation language is CREATE TABLE AS which can be used to create a new table built from contents of result set by a query on a table that already exists within the database. La manipolazione dei dati di SQL lingua è CREATE TABLE AS che può essere utilizzato per creare una nuova tabella costruita dal contenuto del set di risultati da una query su una tabella che già esiste all'interno del database. Both the column types, and row data for the new table, come from the SELECT command specified by select. Entrambi i tipi di colonna, riga e dati per la nuova tabella, proviene dal comando SELECT specificato da selezionare.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS ha la seguente sintassi o sinossi in forma semplice:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(colonna [, ...])] AS SELECT [(colonna [, ...])] esistenti table_name
The SELECT statement can be in a complex form where data is been retrieved from several tables. La dichiarazione SELECT può essere in una forma complessa quando i dati sono stati recuperati da diverse tabelle. For the new table, column names can be specified by including the column names in a comma-delimited list. Per la nuova tabella, nomi di colonna può essere specificato tramite compresi i nomi di colonna in un delimitato da virgole elenco. Very important point to take note is that there should be the same number of columns specified in the column list preceding the AS clause (optional, if specified) for new table as the number of target columns that are returned by the select statement. Punto molto importante a prendere atto è che ci dovrebbe essere lo stesso numero di colonne specificate nella colonna elenco che precede la clausola AS (opzionale, se specificato) per la nuova tabella come il numero di colonne obiettivo che vengono restituiti da selezionare la dichiarazione. If the optional list of columns in parentheses of new table contains different number of rows than the rows the SELECT statement returns, the following error message will be displayed: Se il opzionale elenco di colonne tra parentesi della nuova tabella contiene un numero di righe rispetto le righe la dichiarazione SELECT restituisce il seguente messaggio di errore verrà visualizzato:
ERROR: CREATE TABLE/AS SELECT has mismatched column count ERRORE: CREATE TABLE / AS SELECT ha non corrispondente colonna contare
In its simplest form, CREATE TABLE AS statement will create a complete backup of an existing table including all columns and data simply by using the statement CREATE TABLE new_table_name AS SELECT * FROM existing_table_name . Nella sua forma più semplice, CREATE TABLE COME dichiarazione di creare un backup completo di una tabella esistente comprese tutte le colonne ei dati semplicemente utilizzando la dichiarazione CREATE TABLE new_table_name AS SELECT * FROM existing_table_name.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una macchina tradotto pagina che è fornito "così come sono" senza garanzia. Machine translation may be difficult to understand. La traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in inglese whenever possible. ogniqualvolta ciò sia possibile.
Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e contribuire a My Digital Life Forums La mia vita digitale forum .
Related Articles Articoli correlati
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Facilmente duplicare, copiare o di backup tabelle di cui Oracle, PostgreSQL, DB2 e SQLite Crea tabella con quanto SQL
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack Hack e Trova, Rivela, Get, recuperare e recuperare tutte le password di Windows con Ophcrack 2 e Rainbow Tabelle
- Recover Lost Data with Unistal Data Recovery Recuperare i dati persi con Unistal di recupero di dati
- Data Recovery and Data Protection via Undelete 2009 Il recupero dei dati e la protezione dei dati tramite Undelete 2009
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle goccia tabella di errore
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 tabella o vista non esiste errore di Oracle
- HTML Color Names HEX Codes Chart Table Html nomi dei colori esadecimali codici tavolo da carteggio
- Criss Angle Vanishing Under Table Magic Trick Revealed Criss angolo di fuga tabella sotto magia trucco rivelato
- Gateway CX2620 Convertible Notebook & Table PC Review by NewsFactor Magazine Gateway CX2620 notebook convertibile & PC tabella revisione da NewsFactor rivista
- Improved Way to Add SLIC (SLP 2.0) Table into BIOS ACPI to Activate Windows Vista OEM Migliore modo per aggiungere SLIC (SLP 2.0) Tabella in BIOS ACPI per attivare Windows Vista OEM


























April 1st, 2007 03:26 1o aprile, 2007 03:26
We can do it also with the query, Possiamo farlo anche con la query,
SELECT * INTO newtable FROM existingtable SELECT * FROM newtable IN existingtable
I think its a little bit shorter. Penso che la sua un po 'più breve.
January 10th, 2008 13:31 Gennaio 10, 2008 13:31
Data in the table that is created using create table as select” is different from the data that is returned when the same select that creates the table is executed separately???? Dati riportati nella tabella che viene creato utilizzando come creare tabella selezionare "è diverso dai dati che viene restituito quando lo stesso che crea selezionare la tabella viene eseguita separatamente?
WE are using the tool PL/SQL Developer . Stiamo usando lo strumento PL / SQL Developer.
Any idea what this problem is due to? Qualsiasi idea di cosa questo problema è dovuto a?