大概這是愚蠢的,但我試圖通過將兩個現有表都添加到product_ID作爲主要和唯一的表中創建一個新表。使用基於唯一ID列的兩個現有表創建一個新表
我試過,但沒有奏效
CREATE TABLE new_table_name
SELECT *
FROM table1 t1, table2 t2, WHERE t1.product_id = t2.product_id;
CREATE TABLE new_table_name
SELECT *
FROM table1 AS t1, table2 AS t2, WHERE t1.product_id = t2.product_id;
您將無法使用*,即您將列出所有列。 – muhmud
,原因是您在兩個表中都有相同名稱的列,例如product_Id,系統不知道要調用第二個product_ID表。 – xQbert