2016-06-28 50 views

回答

1

這是非常簡單的:當你的連接關閉

CREATE TEMPORARY TABLE tempname AS ( 
     SELECT whatever, whatever 
      FROM rawtable 
      JOIN othertable ON this = that 
    ) 

的臨時表將消失。臨時表包含創建時捕獲的數據。

您也可以像創建視圖一樣。

CREATE VIEW viewname AS ( 
    SELECT whatever, whatever 
     FROM rawtable 
     JOIN othertable ON this = that 
) 
+0

如何使用您的這個查詢與此: 選擇org_basic.id,org_basic.tmp_org_id,alphanumeric_code.ORG_ID FROM org_basic INNER JOIN alphanumeric_code ON org_basic.id = alphanumeric_code.id ORDER BY alphanumeric_code.id –

+0

CREATE TEMPORARY TABLE tempname AS( SELECT org_basic.id,org_basic.tmp_org_id,alphanumeric_code.ORG_ID \t \t FROM org_basic \t \t INNER JOIN alphanumeric_code \t \t ON org_basic.id = alphanumeric_code.id ORDER BY alphanumeric_code.id ) –

+0

獲取語法錯誤 –