0
我試圖插入一個右連接的結果到我創建的表deal_classification_DM的列CATO_NAME。 選擇的結果是我期望的和程序運行良好,但數據不更新到表中。 有什麼問題?數據不會插入到表使用插入和正確加入
`INSERT INTO deal_classification_DM
(CATO_NAME)
SELECT
taxonomies.NAME
FROM
taxonomies
RIGHT JOIN
deal_classification_DM ON taxonomies.ID = deal_classification_DM.CATO_ID;
插入在其中我喜歡這個創建的表deal_classification_DM完成:
CREATE TABLE deal_classification_DM
AS SELECT
deal_taxonomy.DEAL_ID
,deal_taxonomy.TAXONOMY_ID AS TAXO_ID
,taxonomies.NAME AS TAXO_NAME
,taxonomies.PARENT_ID AS CATO_ID
FROM
deal_taxonomy
LEFT JOIN
taxonomies ON deal_taxonomy.TAXONOMY_ID = taxonomies.ID;
ALTER TABLE deal_classification_DM
ADD COLUMN
CATO_NAME TEXT;
謝謝你的回答! –