2016-07-02 9 views
-2

人は、mysqlの一時テーブル内で一時テーブルを使用することは可能ですか?私はmysqlで一時テーブルを作成

CREATE TEMPORARY TABLE bo_attribute_description_group_temp (
    SELECT id 
    FROM bo_attribute_description_group 
    WHERE display_name IN ('backoffice.attr.group.services', 'backoffice.attr.group.eyecatchergroup') 
); 

select * from bo_attribute_description_group_temp; 

CREATE TEMPORARY TABLE bo_attribute_description_temp (
    SELECT id 
    FROM bo_attribute_description 
    WHERE group_id IN (bo_attribute_description_group_temp) 
); 

を使用しますが、それは私に

Error Code: 1054. Unknown column 'bo_attribute_description_group_temp' in 'where clause' 0.000 sec 

理由を与える場合など ???

答えて

0

はいできます。

CREATE TEMPORARY TABLE bo_attribute_description_group_temp (SELECT id 
                 FROM bo_attribute_description_group 
                 WHERE display_name IN ('backoffice.attr.group.services', 'backoffice.attr.group.eyecatchergroup')); 

select * from bo_attribute_description_group_temp; 

CREATE TEMPORARY TABLE bo_attribute_description_temp (SELECT id 
                FROM bo_attribute_description 
                WHERE group_id IN (select id from bo_attribute_description_group_temp)); 
+0

どちらも機能しませんでした –

+0

エラーメッセージは何ですか? –

関連する問題