Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Ustvarjanje nove tabele z izbiro podatkov iz drugih tabel s CREATE TABLE AS
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. Z uporabo SQL podatkov manipulacije izjavo, novo, začasno, backup ali redne preglednice lahko ustvarite in zasedena ali vstavi podatke iz druge tabele ali tabel, ki jih Vzpostavljeno SELECT izjavo. 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. SQL jezik za manipulacijo podatkov je CREATE TABLE AS, ki se lahko uporabijo za ustvarjanje nove tabele zgrajene iz vsebine rezultat, ki ga je določil poizvedbo v tabeli, ki že obstaja v bazi podatkov. Both the column types, and row data for the new table, come from the SELECT command specified by select. Oba stolpca vrste in vrstica podatkov za nove tabele, prihajajo iz SELECT ukaz, ki ga izberete.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS je naslednji sintaksi ali sinopsis v preprosti obliki:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(stolpec [, ...])] AS SELECT [(stolpec [, ...])] iz obstoječih table_name
The SELECT statement can be in a complex form where data is been retrieved from several tables. V SELECT izjavo lahko v kompleksne oblike, kjer so bili podatki pridobljeni iz več tabel. For the new table, column names can be specified by including the column names in a comma-delimited list. Za nova tabela, stolpec imena se lahko določi tudi stolpec imen v comma-razmejenega seznam. 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. Zelo pomembna točka, da upoštevajo, da mora biti isto število stolpcev je določeno v stolpcu seznam pred AS klavzula (neobvezno, če je določeno) za nove tabele, kot je število ciljnih stolpcev, ki so jih vrne izberite izjavo. 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: Če je neobvezna seznam stolpcev v oklepaju za nova tabela vsebuje različno število vrstic od vrstice v SELECT izjavo vrne, se prikaže sporočilo o napaki se prikaže:
ERROR: CREATE TABLE/AS SELECT has mismatched column count NAPAKA: CREATE TABLE / AS SELECT je neusklajeno stolpcu count
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 . V svoji najenostavnejši obliki, CREATE TABLE AS izjava bo ustvaril popolno varnostno kopijo obstoječega tabela vključuje vse stolpce in podatke preprosto z izjavo CREATE TABLE new_table_name AS SELECT * FROM existing_table_name.
IMPORTANT : The page is machine translated and provided "as is" without warranty. POMEMBNO: Ta stran je stroj prevod in če "kot je" brez garancije. Machine translation may be difficult to understand. Strojno prevajanje je lahko težko razumeti. Please refer to Prosimo, da original English article original English članek whenever possible. kadar je to mogoče.
Related Articles Sorodni članki
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Preprosto Podvoji, Kopiraj ali varnostno kopiranje tabel v Oracle, PostgreSQL, DB2 in SQLite z Ustvarite Tabela Kot SQL
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop Tabela Napaka
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 Tabela ali pogled ne obstaja Oracle Napaka
- Create Business Graphics Via VizLytics Data Visualization Tool Ustvari Business Graphics Via VizLytics Data Visualization Tool
- Oracle ORA-14074 Create or Add New Partition Fails Error Oracle ORA-14074 Ustvari Dodaj novo particijo ali ne Napaka
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack in Hack Iskanje, razkrij, Get, obnovitev in Naloži Vsi Windows Gesla z Ophcrack 2 in Rainbow Tables
- SLIC Table (SLIC.BIN or ACPISLIC.BIN) BIOS File for OEMs Download SLIC Tabela (SLIC.BIN ali ACPISLIC.BIN) BIOS datoteke za OEMs Download
- PDFtoExcel Online Tool Extract PDF Tables to Excel Format PDFtoExcel Online Orodje Extract PDF tabele v Excel Format
- How to Show and Display IP Routing Table in Windows or Linux Kako Prikaži Prikaži IP in usmerjevalne tabele v Windows ali Linux
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error Ustvari, Dodaj ali Split Oracle Database particije ne z ORA-14080 Napaka










































January 28th, 2009 17:46 28. januar 2009 17:46
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(stolpec [, ...])] AS SELECT [(stolpec [, ...])] iz obstoječih table_name
this query possible in MS-ACCESS or not to vprašanje je mogoče, v MS-ACCESS ali ne
January 10th, 2008 13:31 10. januar 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???? Podatki v tabeli, ki je proizvedena s pomočjo ustvarite preglednico izberite "se razlikujejo od podatkov, ki se vrne, kadar isti izberite ki ustvarja tabele se izvrši ločeno??
WE are using the tool PL/SQL Developer . WE uporabljate orodje PL / SQL Developer.
Any idea what this problem is due to? Kakšna ideja, kaj je ta problem posledica?
April 1st, 2007 03:26 1. april 2007 03:26
We can do it also with the query, Mi lahko to storite tudi s poizvedbo,
SELECT * INTO newtable FROM existingtable SELECT * INTO newtable IZ existingtable
I think its a little bit shorter. Mislim, da njeno malo krajše.