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 데이터 조작을 사용하여 성명, 새, 임시, 백업 또는 일반 테이블을 만들 수있습니다 및 다른 테이블에서 데이터를 입력하거나 또는 테이블을 삽입 '을 선택 성명합니다. 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. the sql 데이터 조작 언어는 테이블을 만들어 새 테이블을 만드는 데 사용할 수있는 내용이 결과 집합을 빌드하는 쿼리에 의해 테이블이 이미 존재하는 데이터베이스 내의합니다. Both the column types, and row data for the new table, come from the SELECT command specified by select. 둘 다 열의 유형, 행 데이터를 새 테이블을, 이리에서 지정하는 명령을 선택하십시오를 선택합니다.

CREATE TABLE AS has the following syntax or synopsis in simple form: 줄거리는 다음과 같은 구문을 테이블을 생성하거나 간단한 양식 :

CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name 테이블을 만들기 new_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. 매우 중요한 부분을 참고 사항이 동일한 수의 열이 있어야합니다 열 목록에 지정되어있습니다으로 앞에있는 조항을 (선택 사항, 지정)을 대상 컬럼의 개수로 새 테이블을 반환하는 문장을 선택합니다. 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: 선택 사항 목록을 열 경우에는 새 테이블을 괄호 안에 서로 다른 내용은 행 수를 포함 성명을 반환보다 더 행을 선택하면 다음과 같은 오류 메시지가 표시됩니다 :

ERROR: CREATE TABLE/AS SELECT has mismatched column count 오류 : 만들기 테이블 /로 열의를 선택 카운트가 일치하지 않습니다

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 . 가장 간단한 양식을 작성 테이블의 백업을 완료 문장은 기존의 테이블을 만드는 모든 열을 포함하고 성명을 사용하여 데이터를 간단하게 테이블을 만들기로 new_table_name * 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 내 디지털 라이프 공개 토론 . 합니다.



2 Responses to “Create New Table by Selecting Data from Other Tables with CREATE TABLE AS” 2 개의 응답을 "다른 테이블에서 데이터를 선택하여 새 테이블을 만들기로 테이블을 만들기"

  1. ikarus
    April 1st, 2007 03:26 2007년 4월 1일 03:26
    1

    We can do it also with the query, 쿼리를 우리와 함께 할 수있어,

    SELECT * INTO newtable FROM existingtable * existingtable를 선택하십시오에서 newtable

    I think its a little bit shorter. 그 조금 짧은 것 같아요.

  2. tariq 타리 크
    January 10th, 2008 13:31 2008년 1월 10일 13:31
    2

    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 개발자합니다.
    Any idea what this problem is due to? 로 인해이 문제가 무엇인지 아직 모르시나요?

Leave a Reply 남길 회신

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 이러한 태그를 사용할 수있습니다 : <a href="" title=""> <acronym title=""> <abbr title=""> <blockquote cite=""> <b> <cite> <code> <델 날짜 = ""> <em> <i> <strike> '<q cite="">

Subscribe without commenting 논평없이 구독 신청
이메일


Custom Search

New Articles 새로운 기사

Incoming Search Terms for the Article 이 문서에 대한 검색어를 수신

create table as select 테이블을 만들기를 선택 - - create table select 테이블을 만들기를 선택 - - create table from select 테이블을 만들기를 선택 - - create new table 새 테이블을 만들기 - - DB2 create table as select 테이블을 만들기를 선택 db2 - - make a new section on myspace 새 섹션을 만들 myspace - - create table with select 테이블을 만들기를 선택 - - create table select 테이블을 만들기를 선택 - - db2 create table as db2 테이블을 만들기 - - create table from select statement 테이블을 만들기 성명을 선택 - - create table as select 테이블을 만들기를 선택 - - how to make a new section on myspace 새로운 섹션을 만드는 방법을 myspace - - create table as select access 테이블을 만들기 액세스를 선택 - - oracle create table as select 오라클 테이블을 만들기를 선택 - - Create table using select 를 사용하여 테이블을 만들기를 선택 - - create table select access 테이블을 만들기 액세스를 선택 - - new table myspace 새 테이블을 myspace - - new section on myspace 새 섹션을 myspace - - db2 create table select db2 만들 테이블을 선택합니다 - - access create table as select 테이블에 액세스를 선택 만들기 - - access create table select 액세스 만들 테이블을 선택합니다 - - oracle create table select 오라클 만들 테이블을 선택합니다 - - create table from other tables 테이블을 다른 테이블 만들기 - - create table with data 테이블에 데이터를 생성 - - create table as select db2 테이블을 생성 db2를 선택 - - db2 create table from select 테이블을 만들기를 선택 db2 - - ORACLE CREATE TABLE SELECT * FROM 오라클 만들기 *에서 테이블을 선택합니다 - - create table from select * 테이블을 만들기를 선택 * - - myspace create new table 새 테이블을 만들 myspace - - DB2 create table from another table db2 테이블에서 다른 테이블을 만들기 - - create table select as 테이블을 만들기로 선택합니다 - - add new section on myspace 새 섹션을 추가 myspace - - CREATE TABLE AS SELECT IN ACCESS 테이블을 만들기에 대한 액세스를 선택 - - create table select from 작성 테이블에서 선택 - - create a table in myspace 테이블을 만들기 myspace - - create new myspace table myspace 테이블을 새로 만들기 - - create table select db2 테이블을 생성 db2를 선택 - - create table from other table 테이블을 다른 테이블을 만들기 - - make another table on myspace 또 다른 테이블을 만들 myspace - - access create table as 테이블에 액세스 만들기 - - myspace new table 새 테이블을 myspace - - create new section 새 섹션 만들기 - - oracle create table from select 오라클 테이블을 만들기를 선택 - - access create table from select 액세스 테이블을 만들기를 선택 - - create table from another table in db2 또 다른 테이블에 테이블을 생성 db2 - - create new table from existing table in oracle 기존 테이블에 새 테이블을 만들기 오라클 - - add tables myspace 장바구니 테이블 myspace - - all 모두 - - create table (select 작성 테이블 (선택 - - create table as select oracle 테이블을 만들기 오라클을 선택 - -