Create New Table by Selecting Data from Other Tables with CREATE TABLE AS Membuat Tabel Baru oleh Memilih Data dari Tabel lain dengan 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. Dengan menggunakan pernyataan SQL manipulasi data, yang baru, sementara, cadangan atau biasa tabel dapat dibuat dan diisi atau dimasukkan dengan data dari tabel lain atau meja diambil oleh pernyataan 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. Manipulasi data di SQL adalah bahasa CREATE TABLE AS yang dapat digunakan untuk menciptakan tabel baru dibangun dari isi dari hasil yang ditetapkan oleh query pada tabel yang sudah ada dalam database. Both the column types, and row data for the new table, come from the SELECT command specified by select. Kedua jenis kolom, dan baris data untuk tabel yang baru, berasal dari perintah SELECT ditentukan oleh pilih.
CREATE TABLE AS has the following syntax or synopsis in simple form: CREATE TABLE AS memiliki sintaks berikut atau sinopsis dalam bentuk sederhana:
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(column [, ...])] AS SELECT [(column [, ...])] DARI ada table_name
The SELECT statement can be in a complex form where data is been retrieved from several tables. Pernyataan SELECT yang dapat dalam bentuk kompleks dimana data yang diambil dari beberapa meja. For the new table, column names can be specified by including the column names in a comma-delimited list. Untuk tabel yang baru, nama kolom dapat ditentukan oleh termasuk dalam kolom nama koma-delimited daftar. 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. Sangat penting untuk dicatat adalah bahwa seharusnya ada yang sama jumlah kolom yang ditentukan dalam daftar kolom yang sebelumnya SEBAGAIMANA ayat (opsional, jika ditentukan) untuk tabel baru sebagai target jumlah kolom yang dikembalikan oleh pernyataan pilih. 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: Jika daftar pilihan kolom dalam tanda kurung baru tabel berisi jumlah baris yang berbeda dibandingkan dengan baris yang pernyataan SELECT kembali, berikut ini pesan kesalahan akan ditampilkan:
ERROR: CREATE TABLE/AS SELECT has mismatched column count ERROR: CREATE TABLE / SELECT AS telah mismatched kolom dihitung
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 . Dalam bentuk sederhana, pernyataan CREATE TABLE AS akan menciptakan sebuah cadangan lengkap dari tabel yang ada termasuk semua kolom dan data hanya dengan menggunakan pernyataan CREATE TABLE new_table_name AS SELECT * FROM existing_table_name.
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL Gandakan mudah, Salin atau Cadangan Tabel di Oracle, PostgreSQL, DB2 dan SQLite dengan Membuat Tabel Sebagai SQL
- ORA-02449 Oracle Drop Table Error Ora-02449 Oracle Drop Tabel Kesalahan
- ORA-00942 Table or View Does Not Exist Oracle Error Ora-00942 Lihat Tabel atau Tidak Exist Oracle Error
- Create Business Graphics Via VizLytics Data Visualization Tool Ciptakan Bisnis Graphics Via VizLytics Visualisasi Data Alat
- Oracle ORA-14074 Create or Add New Partition Fails Error Oracle Ora-14074 Buat atau Tambah Baru Partisi gagal Kesalahan
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables Crack dan Hack ke Cari, mengungkapkan, Dapatkan, dan Recover Ambil Semua Windows Sandi dengan Ophcrack 2 dan Rainbow Tables
- SLIC Table (SLIC.BIN or ACPISLIC.BIN) BIOS File for OEMs Download SLIC Tabel (SLIC.BIN atau ACPISLIC.BIN) file BIOS untuk OEMs Download
- PDFtoExcel Online Tool Extract PDF Tables to Excel Format Online Tool PDFtoExcel Ambil PDF Tabel ke Excel Format
- How to Show and Display IP Routing Table in Windows or Linux Bagaimana Perlihatkan IP Routing dan Tampilan Tabel pada Windows atau Linux
- Create, Add or Split Oracle Database Partition Fails with ORA-14080 Error Membuat, Tambah atau Split Oracle Database Partisi gagal dengan Ora-14080 Kesalahan










































January 28th, 2009 17:46 Januari 28, 2009 17:46
CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name CREATE TABLE new_table_name [(column [, ...])] AS SELECT [(column [, ...])] DARI ada table_name
this query possible in MS-ACCESS or not permintaan ini mungkin MS-ACCESS atau tidak
January 10th, 2008 13:31 Januari 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???? Data dalam tabel yang dibuat dengan membuat tabel sebagai pilih "berbeda dengan data yang dikembalikan pada saat yang sama pilih yang membuat tabel dijalankan secara terpisah?
WE are using the tool PL/SQL Developer . WE menggunakan alat PL / SQL Developer.
Any idea what this problem is due to? Any idea apa masalah ini disebabkan?
April 1st, 2007 03:26 April 1, 2007 03:26
We can do it also with the query, Kami juga dapat melakukannya dengan permintaan,
SELECT * INTO newtable FROM existingtable SELECT * INTO newtable DARI existingtable
I think its a little bit shorter. I think its sedikit singkat.