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.
Related Articles Susiję straipsniai
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Geras dublikatas, kopija ar pasikartojančios lentelės Oracle, PostgreSQL, DB2 ir SQLite su Sukurkite lentelę SQL
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop Table Klaida
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 lentelę ar vaizdas neegzistuoja Oracle Klaida
- Create Business Graphics Via VizLytics Data Visualization Tool Kurti verslo Grafika Via VizLytics vizualizacijos įrankis
- Oracle ORA-14074 Create or Add New Partition Fails Error "Oracle" ORA-14074 Kurti arba Pridėti naują skyrių fails Klaida
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack ir Hack Rasti atskleidžia, Gauti, atkurti ir gauti visus "Windows" slaptažodžius ophcrack 2 ir Rainbow Lentelės
- SLIC Table (SLIC.BIN or ACPISLIC.BIN) BIOS File for OEMs Download VDIK lentelė (SLIC.BIN arba ACPISLIC.BIN) BIOS File OEM Atsisiųsti
- PDFtoExcel Online Tool Extract PDF Tables to Excel Format PDFtoExcel internetinis įrankis Ištrauka PDF lenteles į Excel formatas
- How to Show and Display IP Routing Table in Windows or Linux Kaip rodyti ir rodyti IP Routing Table Windows arba Linux
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error Kurti, Pridėti arba neskaldytos Oracle Pasiskirstymo fails su klaida ORA-14080










































September 5th, 2009 14:30 Rugsėjis 5, 2009 14:30
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ą.
January 28th, 2009 17:46 28 sausis 2009 17:46
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
January 10th, 2008 13:31 10 sausis 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???? 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?
April 1st, 2007 03:26 1 balandis 2007 03:26
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.