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. בכל הזדמנות אפשרית.
Related Articles מאמרים קשורים
- Easily Duplicate, Copy or Backup Tables in Oracle, PostgreSQL, DB2 and SQLite with Create Table As SQL בקלות לשכפל, להעתיק או לוחות הגיבוי ב-Oracle, PostgreSQL, SQLite ו-DB2 עם יצירת טבלה כפי SQL
- ORA-02449 Oracle Drop Table Error ORA-02449-Oracle זרוק טבלה שגיאה
- ORA-00942 Table or View Does Not Exist Oracle Error ORA-00942 או לוח האם לא הצג שגיאה אורקל Exist
- Create Business Graphics Via VizLytics Data Visualization Tool ליצור עסקים גרפיקה VizLytics נתונים באמצעות כלי וויזואליזציה
- Oracle ORA-14074 Create or Add New Partition Fails Error אורקל ORA-14074 יצירת מחיצה חדשה או הוסף נכשל שגיאה
- Crack and Hack to Find, Reveal, Get, Recover and Retrieve All Windows Passwords with Ophcrack 2 and Rainbow Tables סדק אל האק מצא, חשוף, קבל, שחזר ולאחזר את כל הסיסמאות של Windows עם Ophcrack 2 ו Rainbow לוחות
- SLIC Table (SLIC.BIN or ACPISLIC.BIN) BIOS File for OEMs Download SLIC טבלה (SLIC.BIN או ACPISLIC.BIN) קובץ ה-BIOS עבור OEMs הורד
- PDFtoExcel Online Tool Extract PDF Tables to Excel Format PDFtoExcel Online בכלי החילוץ לוחות PDF ל-Excel פורמט
- How to Show and Display IP Routing Table in Windows or Linux כיצד להציג ולהציג טבלת ניתוב ה-IP ב-Windows או Linux
- How to Delete and Remove a Route Rule from Windows Routing Table כיצד למחוק ו הסרה של כלל כביש מ-Windows טבלת ניתוב










































September 5th, 2009 14:30 5 ספטמבר 2009 14:30
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. מקווה שזה יפתור את הבעיה שלך.
January 28th, 2009 17:46 28 ינואר 2009 17:46
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 או לא
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? יש לך מושג מה הבעיה הזו נובעת?
April 1st, 2007 03:26 1 אפריל 2007 03:26
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. אני חושב שלו קצת קצר יותר.