Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Vytvořit novou tabulku výběr dat z jiných tabulek se vytvořit tabulku jako
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. Pomocí SQL pro manipulaci s daty prohlášení, nový, dočasný, nebo pravidelného zálohování tabulka může být vytvořena a obsazena nebo vložené s daty z jiné tabulky nebo tabulek získáte 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. V jazyce SQL pro manipulaci s daty je CREATE TABLE AS, které mohou být použity k vytvoření nové tabulky postaveno z obsahu výsledek stanovené dotaz na tabulku, která již existuje v databázi. Both the column types, and row data for the new table, come from the SELECT command specified by select. Oba druhy sloupec, řádek a data pro nové tabulky, pocházejí z příkazové uvedeny SELECT, které vyberete.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS má následující syntaxe nebo v synopsi jednoduchý formulář:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(sloupec [, ...])] AS SELECT [(sloupec [, ...])] ze stávajících TABLE_NAME
The SELECT statement can be in a complex form where data is been retrieved from several tables. Vyberte tvrzení může být v tak složité formuláře, pokud data byla načtena z několika tabulek. For the new table, column names can be specified by including the column names in a comma-delimited list. Pro nový sloupec jména mohou být uvedeny včetně jmen sloupců v čárka-oddělený 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. Velmi důležitým bodem je, aby vzaly na vědomí, že by měl být stejný počet sloupců je uvedeno ve sloupci seznamu předcházejících AS klauzule (nepovinné, pokud uvedeno) pro novou tabulku jako cílový počet sloupců, které jsou vráceny do vybrat prohlášení. 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: Pokud volitelný seznam sloupců v závorce nové tabulka obsahuje různý počet řádků, než je výpis řadách Vyberte vrací se následující chybová zpráva bude zobrazen:
ERROR: CREATE TABLE/AS SELECT has mismatched column count ERROR: CREATE TABLE / AS SELECT sloupec má špatně počítat
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 . Ve své nejjednodušší podobě, CREATE TABLE AS prohlášení vytvoří kompletní zálohu stávajících stolu včetně všech sloupců a data jednoduše pomocí výkazu 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. Upozornění: Tento stroj je přeložen stránky, který je poskytován "tak jak jsou", bez záruky. Machine translation may be difficult to understand. Strojový překlad může být obtížné porozumět. Please refer to Odkazujeme na original English article Anglický originál článku whenever possible. kdykoli je to možné.
Share and contribute or get technical support and help at Sdílení a přispět nebo získat technickou podporu a pomoc při My Digital Life Forums My Digital Life fóra .
Related Articles Související články
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Snadno duplikovat, kopírovat nebo záložní zdroje v prostředí Oracle, PostgreSQL, DB2 a SQLite s Vytvořte tabulku jako SQL
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack Hack Najít a odhalit, získat, se zotavit a načíst všechny Windows s hesly Ophcrack 2 a Rainbow Tabulky
- Recover Lost Data with Unistal Data Recovery Recover Lost data s Unistal Obnova dat
- Data Recovery and Data Protection via Undelete 2009 Zotavení dat a ochranu osobních údajů prostřednictvím Undelete 2009
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop tabulce chyba
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 tabulku nebo pohled neexistuje Oracle chyba
- HTML Color Names HEX Codes Chart Table HTML barvu jména HEX kódy chart tabulka
- Criss Angle Vanishing Under Table Magic Trick Revealed Kami úhel tonou v tabulce Magic Trick Revealed
- Gateway CX2620 Convertible Notebook & Table PC Review by NewsFactor Magazine Gateway CX2620 Konvertibilní notebook & stolních PC přezkumu NewsFactor Magazine
- Improved Way to Add SLIC (SLP 2.0) Table into BIOS ACPI to Activate Windows Vista OEM Lepší způsob Přidat SLIC (SLP 2.0) tabulka do BIOS ACPI k aktivaci systému Windows Vista OEM


























April 1st, 2007 03:26 1. dubna 2007 03:26
We can do it also with the query, Můžeme to udělat také s dotazem,
SELECT * INTO newtable FROM existingtable SELECT * INTO newtable OD existingtable
I think its a little bit shorter. Myslím, že její trochu kratší.
January 10th, 2008 13:31 10. ledna 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???? Údaje v tabulce, která je vytvořena pomocí vytvořit tabulku, jak vybrat "se liší od údajů, které se vrací, když stejný vybrat, který vytváří v tabulce je proveden zvlášť??
WE are using the tool PL/SQL Developer . Jsme pomocí nástroje PL / SQL Developer.
Any idea what this problem is due to? Máte ponětí, co tento problém je způsoben?