Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Sukurti naują lentelę, pasirinkdami duomenys iš kitos lentelės su 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. Naudodami SQL duomenų manipuliavimo pareiškimą, naujas laikinas, kopijavimas ar reguliariais lentelės gali būti kuriamos ir pildomos ar Įrašytas duomenis iš kitos lentelės ar lentelių išrinktą 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. SQL duomenų manipuliavimo kalbos CREATE TABLE AS, kuri gali būti naudojama siekiant sukurti naują lentelę, pastatytas iš turinį rezultato nustatytas ant stalo, kad jau per duomenų bazės užklausos. Both the column types, and row data for the new table, come from the SELECT command specified by select. Abiejų tipų kolonėlių, ir eilučių duomenis naujoje lentelėje, iš SELECT komanda nurodytą pasirinkite.

CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS sintaksė yra tokia ar anotacijomis paprasta forma:

CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(kolonėlės [...])] KAIP PASIRINKTI [(kolonėlės [...])] iš esamų table_name

The SELECT statement can be in a complex form where data is been retrieved from several tables. SELECT gali būti sudėtingos formos, kai duomenys buvo gauti iš kelių lentelių. For the new table, column names can be specified by including the column names in a comma-delimited list. Naujos lentelės stulpelių pavadinimai gali būti nurodomi įskaitant stulpelių pavadinimus kableliais sąrašą. 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. Labai svarbus punktas atkreipia dėmesį, kad ten reikia tą patį skaičių kolonoms, nurodytoms skiltyje sąrašas praėjusių AS sąlygos (pasirinktinai, jei nenurodyta ") ir nauja lentelė, kaip tikslinių stulpelių skaičių, kad būtų grąžintos SELECT. 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: Jei neprivaloma sąrašo skiltyse skliaustuose naujų lentelėje pateikiama įvairių skaičių eilutes kaip eilutes SELECT grąžą, po klaidos pranešimas bus rodomas:

ERROR: CREATE TABLE/AS SELECT has mismatched column count ERROR: CREATE TABLE / AS SELECT turi nesutampa stulpelyje skaičius

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 . Savo paprasčiausia forma, CREATE TABLE AS pareiškimas bus sukurti pilną atsarginę kopiją iš esamos lentelės, įskaitant visus stulpelius ir duomenis, tiesiog naudojant CREATE TABLE new_table_name AS SELECT * FROM existing_table_name pareiškimą.

IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Automatinis vertimas gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.


4 Responses to “Create New Table by Selecting Data from Other Tables with CREATE TABLE AS” 4 Responses to "Sukurti naują lentelę, pasirinkdami duomenys iš kitos lentelės su CREATE TABLE AS"

  1. Imran Aziz Khan Imran Aziz Khan
    September 5th, 2009 14:30 Rugsėjis 5, 2009 14:30
    4 4

    Check your select statement again and shuffle the joining conditions in where clause. Patikrinkite savo SELECT vėl ir Shuffle prisijungimo sąlygas, jei sąlygos. No need to change but change the position. Keisti nereikia, bet pakeisti poziciją. Try to equate id's first and contants latter. Pabandykite prilyginti ID pirmoji ir contants pastarasis. Hope this will solve your problem. Tikiuosi, kad tai padės išspręsti problemą.

  2. Dinesh Dinesh
    January 28th, 2009 17:46 28 sausis 2009 17:46
    3 3

    CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(kolonėlės [...])] KAIP PASIRINKTI [(kolonėlės [...])] iš esamų table_name

    this query possible in MS-ACCESS or not šią užklausą įmanoma MS Access ar ne

  3. tariq Tariq
    January 10th, 2008 13:31 10 sausis 2008 13:31
    2 2

    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???? Duomenų lentelėje, kuri yra sukurta naudojantis sukurti lentelę pasirinkite "skiriasi nuo duomenų, kurie yra grąžinami, kai pats pasirinkti, kuris sukuria lentelę yra vykdoma atskirai??
    WE are using the tool PL/SQL Developer . Mes naudojant įrankį PL / SQL Developer.
    Any idea what this problem is due to? Bet idėja, ką ši problema yra dėl to?

  4. ikarus Ikarus
    April 1st, 2007 03:26 1 balandis 2007 03:26
    1 1

    We can do it also with the query, Mes galime tai daryti taip pat su užklausa,

    SELECT * INTO newtable FROM existingtable SELECT * INTO newtable IŠ existingtable

    I think its a little bit shorter. Manau, kad jos truputį trumpesnis.

Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Galite naudoti šiuos žodžius: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Subscribe to comments funkcija buvo išjungta. To receive notification of latest comments posted, subscribe to Norėdami gauti pranešimus apie naujausius komentarų, užsiprenumeruoti My Digital Life Comments RSS feed Mano skaitmeninis gyvenimas Komentarų RSS or arba register to receive Registruokitės gauti new comments in daily email digest. Nauji komentarai kasdien elektroniniu paštu.
Custom Search

New Articles Nauji straipsniai

Incoming Search Terms for the Article Gaunamus paieškos terminus straipsnis

create table as select CREATE TABLE kaip pasirinkti - -- create table select CREATE TABLE pasirinkite - -- create table as select from CREATE TABLE kaip pasirinkti - -- create table with select sukurti lentelę pasirinkite - -- create table from select CREATE TABLE iš pasirinktų - -- db2 create table as select DB2 sukurti lentelę kaip pasirinkti - -- create table from select statement CREATE TABLE iš SELECT - -- create table select from CREATE TABLE pasirinkti - -- db2 create table from select DB2 sukurti lentelė pasirinkite - -- create new table sukurti naują lentelę - -- access create table ryšys CREATE TABLE - -- create table as select DB2 sukurti lentelę pasirinkite DB2 - -- select create table pasirinkite CREATE TABLE - -- db2 create table select DB2 CREATE TABLE pasirinkite - -- create table as select CREATE TABLE kaip pasirinkti - -- CREATE TABLE USING SELECT STATEMENT CREATE TABLE naudojant SELECT - -- create table with data sukurti lentelę su duomenimis - -- db2 create table as DB2 sukurti lentelę - -- oracle select into new table Oracle pasirinkti į naują lentelę - -- all visi - -- create table select into CREATE TABLE pasirinkti į - -- create table select CREATE TABLE pasirinkite - -- create a data table sukurkite duomenų lentelę - -- create table into CREATE TABLE į - -- MS Access Create table as select MS Access Sukurti lentelėje pasirinkite - -- create table as select in db2 sukurti lentelę pasirinkote DB2 - -- access create table as select ryšys sukurti lentelėje pasirinkite - -- create table as select ms access CREATE TABLE kaip pasirinkti MS Access - -- MS ACCESS CREATE TABLE SELECT MS ACCESS CREATE TABLE SELECT - -- sqlite create table as select SQLite sukurti lentelę kaip pasirinkti - -- create table select db2 CREATE TABLE pasirinkite DB2 - -- access create table select prieigos CREATE TABLE pasirinkite - -- db2 create table from another table DB2 kurti lentelę kitoje lentelėje - -- sql create table from select statement SQL sukurti lentelė SELECT - -- Creating tables thru union query in MS access + select into Kurti lenteles per Sąjungos užklausą MS Access + pasirinkti į - -- oracle create table as select Oracle "CREATE TABLE kaip pasirinkti - -- create table access CREATE TABLE ryšys - -- create table+select CREATE TABLE + pasirinkti - -- how to create a data table Kaip sukurti duomenų lentelė - -- create table using select sudaryti lentelę, naudojant pasirinkite - -- CREATE TABLE SELECT ACCESS CREATE LENTELĖ IŠSIRINKTI PRIEIGOS - -- create table with data from another table sudaryti lentelę su duomenimis iš kitos lentelės - -- create table select as CREATE TABLE išsirinkti - -- create table from existing table in Db2 CREATE TABLE iš esamos lentelės DB2 - -- create table as select access sukurti lentelę pasirinkite prieigos - -- SQL Insert table data via select statement SQL Įterpti lentelės duomenis per SELECT - -- access create table from select ryšys sukuria lentelė pasirinkite - -- oracle create backup table Oracle "atsarginių lentelė - -- db2 create table as select from DB2 sukurti lentelę kaip pasirinkti - -- db2 create table as select * from DB2 sukurti lentelę SELECT * FROM - -- create table (select CREATE TABLE (pasirinkite - -- select into new table oracle pasirinkite į naują lentelę Oracle - -- create table from another table in db2 CREATE TABLE iš kitos lentelės DB2 - -- create table using select db2 sudaryti lentelę, naudojant pasirinkite DB2 - -- access create table as ryšys sukurti lentelę - -- oracle create table backup "Oracle" CREATE TABLE atsargine - -- create table as (select sukurti lentelę (pasirinkite - -- create backup table sql Sukurti atsarginę lentelę SQL - -- create table from select CREATE TABLE iš pasirinktų - -- create table from select statement oracle CREATE TABLE iš SELECT orakulas - -- create table with select sukurti lentelę pasirinkite - -- ms access create table from select MS Access sukuria lentelę iš pasirinktų - -- db2 create table as DB2 sukurti lentelę - -- oracle create table select Oracle "CREATE TABLE pasirinkite - -- microsoft access create table as select Microsoft Access sukuria lentelę kaip pasirinkti - -- create table another table db2 kurti lentelę kitoje lentelėje DB2 - -- CREATE TABLE INTO SELECT CREATE TABLE INTO SELECT - -- make a data table online padaryti duomenų lentelės internete - -- create data table sukurkite duomenų lentelę - -- CREATE TABLE AS SELECT ORACLE CREATE TABLE KAIP PASIRINKTI ORACLE - -- create table + select CREATE TABLE + pasirinkti - -- create a backup table in SQL sukurti atsarginę lentelę SQL - -- create a table from select statement Sukurkite lentelę iš SELECT - -- create table from other table CREATE TABLE iš kitos lentelės - -- create backup table in sql Sukurti atsarginę lentelę SQL - --