Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Crear Nueva Tabla de Selección de datos de otras tablas con CREATE TABLE COMO
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. Mediante el uso de la manipulación de datos de SQL declaración, una nueva, de carácter temporal, copia de seguridad de la tabla periódica o se puede crear o se inserta y se llena con los datos de otra tabla o tablas recuperado por 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. El lenguaje de manipulación de datos de SQL CREATE TABLE como es que puede ser usado para crear una nueva tabla de contenido construido a partir de conjunto de resultados de una consulta en una tabla que ya existe dentro de la base de datos. Both the column types, and row data for the new table, come from the SELECT command specified by select. Tanto los tipos de columna y fila de datos para la nueva tabla, vienen de la especificada por el comando SELECT seleccione.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS dispone de la siguiente sintaxis o sinopsis en forma simple:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(columna [, ...])] AS SELECT [(columna [, ...])] FROM table_name existentes
The SELECT statement can be in a complex form where data is been retrieved from several tables. La sentencia SELECT pueden ser una forma compleja en que los datos se han recuperado de varias tablas. For the new table, column names can be specified by including the column names in a comma-delimited list. Para la nueva tabla, nombres de columna se puede especificar la inclusión de los nombres de columna en una lista delimitada por comas. 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. Punto muy importante a tener en cuenta es que debe haber el mismo número de columnas especificado en la lista de columnas como la cláusula anterior (opcional, si se especifica) para la nueva tabla como objetivo el número de columnas que se devuelven por el 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: Si la lista opcional de paréntesis en las columnas de una nueva tabla contiene un número distinto de filas de las filas de la sentencia SELECT devuelve el siguiente mensaje de error se mostrará:
ERROR: CREATE TABLE/AS SELECT has mismatched column count ERROR: CREATE TABLE / AS SELECT tiene mal columnas
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 . En su forma más simple, como declaración de CREATE TABLE creará una copia de seguridad completa de una tabla existente entre ellos y todas las columnas de datos, utilizando simplemente la declaración CREATE TABLE new_table_name AS SELECT * FROM existing_table_name.
IMPORTANT : The page is machine translated and provided "as is" without warranty. IMPORTANTE: La página está traducida máquina y proporciona "tal cual" sin garantía. Machine translation may be difficult to understand. La traducción automática puede resultar difícil de entender. Please refer to Por favor, consulte original English article artículo original Inglés whenever possible. siempre que sea posible.
Related Articles Artículos relacionados
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Fácilmente duplicar, copiar o de copia de seguridad en los cuadros de Oracle, PostgreSQL, DB2 y SQLite con Crear Mesa Como SQL
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle caída cuadro de error
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 tabla o vista no existe error de Oracle
- Create Business Graphics Via VizLytics Data Visualization Tool Crear gráficos comerciales Via VizLytics Herramienta de Visualización de Datos
- Oracle ORA-14074 Create or Add New Partition Fails Error Oracle ORA-14074 Crear o añadir nuevas particiones falla de error
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack Hack y encontrar, revelan, Obtener, recuperar y recuperar todas las contraseñas de Windows con Ophcrack 2 y los cuadros de Rainbow
- SLIC Table (SLIC.BIN or ACPISLIC.BIN) BIOS File for OEMs Download Cuadro SLIC (SLIC.BIN o ACPISLIC.BIN) BIOS del archivo de descarga para los OEM
- PDFtoExcel Online Tool Extract PDF Tables to Excel Format Herramienta en línea PDFtoExcel Extracto PDF a Excel Formato Tablas
- How to Show and Display IP Routing Table in Windows or Linux Cómo mostrar la pantalla y la tabla de enrutamiento IP en Windows o Linux
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error Crear, Añadir o base de datos Oracle Split partición falla con el error ORA-14080










































January 28th, 2009 17:46 28 de enero, 2009 17:46
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(columna [, ...])] AS SELECT [(columna [, ...])] FROM table_name existentes
this query possible in MS-ACCESS or not posible esta consulta en MS-ACCESS o no
January 10th, 2008 13:31 10 de enero de 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???? Los datos en la tabla que se creó utilizando como crear la tabla, seleccione "es diferente a partir de los datos que se devuelve cuando se selecciona la misma que crea la tabla se ejecuta por separado?
WE are using the tool PL/SQL Developer . Estamos utilizando la herramienta de PL / SQL Developer.
Any idea what this problem is due to? Cualquier idea de lo que este problema se debe a?
April 1st, 2007 03:26 1ro de abril de 2007 03:26
We can do it also with the query, Podemos hacerlo también con la consulta,
SELECT * INTO newtable FROM existingtable SELECT * INTO newtable DE existingtable
I think its a little bit shorter. Creo que es un poco más corto.