Create New Table by Selecting Data from Other Tables with CREATE TABLE AS צור טבלה חדשה על ידי בחירת נתונים מתוך טבלאות אחרות עם כטבלה CREATE

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. שני סוגי העמודה ונתוני השורה על השולחן החדש, באה הפקודה בחר שצוין על ידי לבחור.

CREATE TABLE AS has the following syntax or synopsis in simple form: ליצור בטבלה התחביר הבא או SYNOPSIS בצורה פשוטה:

CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name New_table_name CREATE TABLE [(טור [, ...])] AS SELECT [(טור [, ...])] table_name קיימים

The SELECT statement can be in a complex form where data is been retrieved from several tables. משפט SELECT יכול להיות מורכב בצורה שבה הוא היה מקור הנתונים מטבלאות מספר. For the new table, column names can be specified by including the column names in a comma-delimited list. עבור שולחן חדש, שמות עמודות ניתן להגדיר על ידי כולל שמות עמודה פסיק-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 ERROR: 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 תיצור גיבוי מלא של השולחן קיים כולל כל עמודות הנתונים פשוט באמצעות הצהרה CREATE new_table_name הטבלה בשם existing_table_name SELECT * FROM.

IMPORTANT : The page is machine translated and provided "as is" without warranty. חשוב: הדף מכונת תירגם מתפרסם "כמות שהוא" ללא אחריות. Machine translation may be difficult to understand. תרגום מכונה יכול להיות קשה להבין. Please refer to נא עיין original English article המאמר המקורי באנגלית whenever possible. בכל הזדמנות אפשרית.


4 Responses to “Create New Table by Selecting Data from Other Tables with CREATE TABLE AS” 4 תגובות ל "צור טבלה חדשה על ידי בחירת נתונים מתוך טבלאות אחרות עם CREATE TABLE AS"

  1. Imran Aziz Khan אימראן עזיז ח 'אן
    September 5th, 2009 14:30 5 ספטמבר 2009 14:30
    4 4

    Check your select statement again and shuffle the joining conditions in where clause. בדוק את ההצהרה שלך לבחור שוב דשדוש התנאים שהצטרף שם סעיף ב. No need to change but change the position. לא צריך לשנות אבל לשנות את המיקום. Try to equate id's first and contants latter. נסו להשוות את הזהות של contants ראשון האחרון. Hope this will solve your problem. מקווה שזה יפתור את הבעיה שלך.

  2. Dinesh דינש
    January 28th, 2009 17:46 28 ינואר 2009 17:46
    3 3

    CREATE TABLE new_table_name [ ( column [, ...] ) ] AS SELECT [ ( column [, ...] ) ] FROM existing table_name New_table_name CREATE TABLE [(טור [, ...])] AS SELECT [(טור [, ...])] table_name קיימים

    this query possible in MS-ACCESS or not זה אפשרי שאילתה ב-MS-Access או לא

  3. tariq טארק
    January 10th, 2008 13:31 10 ינואר 2008 13:31
    2 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 Developer.
    Any idea what this problem is due to? יש לך מושג מה הבעיה הזו נובעת?

  4. ikarus Ikarus
    April 1st, 2007 03:26 1 אפריל 2007 03:26
    1 1

    We can do it also with the query, אנחנו יכולים לעשות זאת גם עם השאילתה,

    SELECT * INTO newtable FROM existingtable SELECT * INTO FROM newtable existingtable

    I think its a little bit shorter. אני חושב שלו קצת קצר יותר.

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=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. כדי להירשם הערות תכונה הושבת. To receive notification of latest comments posted, subscribe to כדי לקבל הודעה העדכנית של תגובות, כדי להירשם My Digital Life Comments RSS feed החיים שלי דיגיטליות תגובות RSS Feed or או register to receive הרשמה לקבלת new comments in daily email digest. תגובות חדש ב דוא"ל תקציר יומי.
Custom Search

New Articles מאמרים חדשים

Incoming Search Terms for the Article תנאי נכנסות חיפוש עבור מאמרים

create table as select ליצור טבלה כמו לבחור - -- create table as select from ליצור טבלה כמו לבחור מתוך - -- CREATE TABLE FROM SELECT CREATE TABLE מ בחר - -- create table select ליצור טבלה בחר - -- create a data table ליצור טבלה נתונים - -- create table select from ליצור טבלה לבחור מתוך - -- db2 create table as select DB2 ליצור טבלה כמו לבחור - -- create table select into ליצור טבלה לתוך בחר - -- create table from another table ליצור שולחן משולחן אחר - -- create new table ליצור טבלה חדשה - -- db2 create table as select from DB2 ליצור טבלה כמו לבחור מתוך - -- db2 create table from select DB2 ליצור שולחן מ בחר - -- oracle select into new table Oracle לבחור לתוך טבלה חדשה - -- create table as select db2 ליצור טבלה כמו לבחור DB2 - -- create table With data ליצור טבלה עם נתונים - -- create table with select statement ליצור טבלה עם הצהרה בחר - -- create table as select oracle ליצור טבלה כמו oracle בחר - -- sql create table from another table SQL ליצור שולחן משולחן אחר - -- create data table ליצור טבלת נתונים - -- create table from select statement ליצור טבלה מתוך הצהרה בחר - -- cREATE TABLE WITH SELECT ליצור טבלת עם SELECT - -- sqlite create table as select SQLite ליצור טבלה כמו לבחור - -- create table select * from ליצור שולחן select * from - -- select into create table בחר לתוך ליצור טבלה - -- create backup table sql ליצור גיבוי SQL השולחן - -- oracle create table as select Oracle ליצור טבלה כמו לבחור - -- create table into ליצור טבלה לתוך - -- db2 create table as with data כמו DB2 ליצור טבלה עם נתונים - -- select create table בחר ליצור טבלה - -- creating table from another table יצירת טבלה מטבלה אחרת - -- db2 create table select DB2 ליצור טבלה בחר - -- access create table as select גישה ליצור טבלה כמו לבחור - -- create a table using select statement ליצור טבלה באמצעות הצהרה בחר - -- how to create a new table in access כיצד ליצור טבלה חדשה ב-Access - -- insert into select create table להכניס לתוך בחר ליצור טבלה - -- create table using select ליצור טבלה באמצעות לבחור - -- create table select as ליצור טבלה לבחור כמו - -- how to create table from another table כיצד ליצור טבלה מטבלה אחרת - -- create new table from select ליצור טבלה חדשה מתוך בחר - -- create table using another table ליצור טבלה באמצעות טבלה אחרת - -- create table using select statement ליצור טבלה באמצעות הצהרה בחר - -- create table With data DB2 ליצור טבלה עם נתונים DB2 - -- create table select statement ליצור הצהרה השולחן לבחור - -- create table select access ליצור גישה לשולחן בחר - -- create table as select access ליצור טבלה כמו גישה בחר - -- create table insert into ליצור להכניס לתוך הטבלה - -- create backup table oracle Oracle ליצור שולחן גיבוי - -- Create a table from a Select statement צור טבלת מן הצהרה בחר - -- db2 create table as select from DB2 ליצור טבלה כמו לבחור מתוך - -- how to create a new table throw a select command כיצד ליצור טבלה חדשה לזרוק הפקודה בחר - --