Create New Table by Selecting Data from Other Tables with 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. С помощью SQL манипулирования данными заявлению, новый, временный, резервное копирование или обычной таблицы может быть создан и наполнен или добавить данные из другой таблицы или таблицы извлекается 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 манипулирования данными язык СОЗДАТЬ таблицу, которая может быть использована для создания новой таблицы построены из содержимого результата, установленные запрос на таблицу, которая уже существует в базе данных. Both the column types, and row data for the new table, come from the SELECT command specified by select. Оба типа столбцов и строк данных в новую таблицу, из команды SELECT указанный выбор.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS имеет следующий синтаксис или резюме в простой форме:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(столбец [, ...])] AS SELECT [(столбец [, ...])] из существующих TABLE_NAME
The SELECT statement can be in a complex form where data is been retrieved from several tables. ВЫБОР заявление может быть в сложной форме, где данные были получены из нескольких таблиц. For the new table, column names can be specified by including the column names in a comma-delimited list. Для новой таблицы, имена столбцов могут быть определены путем включения в колонку имена-запятыми список. 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. Очень важный момент принять к сведению, что там должно быть такое же число столбцов, указанных в колонке список предшествующих AS положение (необязательно, если указана) для новой таблицы, как количество целевых столбцов, которые возвращаются в выборе заявление. 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: Если факультативные список столбцов в скобках новой таблице содержатся различные количества строк, чем строки SELECT возвращает заявление, следующее сообщение об ошибке будет отображаться:
ERROR: CREATE TABLE/AS SELECT has mismatched column count ОШИБКА: CREATE TABLE / AS SELECT имеет несоответствующих колонка кол
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 . В своей простейшей форме, создать таблицу в заявлении будут создавать полную резервную копию существующей таблицы, включая все столбцы и данные просто с помощью заявления, 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. ВАЖНО: Это машина переведена страницу, которая предоставляется "как есть" без гарантии. Machine translation may be difficult to understand. Машинный перевод может быть трудным для понимания. Please refer to Пожалуйста, обратитесь к original English article Английский оригинальные статьи whenever possible. когда это возможно.
Share and contribute or get technical support and help at Делите и вклад или получить техническую поддержку и помощь в My Digital Life Forums Моя Цифровая жизнь Форумы .
Related Articles Статьи по теме
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Легко повторяющиеся, копирования Backup или таблиц в Oracle, PostgreSQL, DB2 и SQLite с Создать Таблица Как SQL
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Крэк и Hack найти, выявить, Get, восстановления и получения всех паролей Windows с Ophcrack 2 и Радуга Таблицы
- Recover Lost Data with Unistal Data Recovery Восстановление утерянных данных с Unistal восстановления данных
- Data Recovery and Data Protection via Undelete 2009 Восстановление данных и защита данных с помощью Восстановить 2009
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop стол ошибке
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 таблица или просмотреть, не существует Ошибка Oracle
- HTML Color Names HEX Codes Chart Table HTML цвет имена HEX коды Таблица Диаграмма
- Criss Angle Vanishing Under Table Magic Trick Revealed Крисс угол нуль в соответствии с таблицей Magic Trick показало,
- Gateway CX2620 Convertible Notebook & Table PC Review by NewsFactor Magazine Gateway CX2620 конвертируемой блокнота И стол компьютера обзор сервис журнал
- Improved Way to Add SLIC (SLP 2.0) Table into BIOS ACPI to Activate Windows Vista OEM Повышение Дорога к Добавить SLIC (SLP 2,0) Таблица в BIOS ACPI для Активировать Windows Vista OEM


























April 1st, 2007 03:26 1 апреля 2007 03:26
We can do it also with the query, Мы можем делать это также с запросом,
SELECT * INTO newtable FROM existingtable SELECT * В newtable ИЗ existingtable
I think its a little bit shorter. Я думаю, его немного короче.
January 10th, 2008 13:31 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???? Данные в таблице, которая создается с помощью создания таблицы, как выбрать ", отличается от данных, которые возвращаются, когда же выбрать, что создает таблицу выполняется отдельно????
WE are using the tool PL/SQL Developer . Мы используем инструмент PL / SQL Developer.
Any idea what this problem is due to? Любая идея, что эта проблема объясняется?