簡體   English   中英

MySQL創建臨時表

[英]MySQL create temporary table

無法理解為什么此創建臨時表不起作用..有人可以建議..嗎?

create temporary table if not exists table2 AS (select unix_timestamp(concat(delivery_date, ' ', str_to_date(delivery_time,'%h:%i%p'))) as timestamp, id from fruit.order_delivery_orders where calendar_id is not null);

它得到一個錯誤“查詢被中斷”。

此查詢工作正常-

select unix_timestamp(concat(delivery_date, ' ', str_to_date(delivery_time,'%h:%i%p'))) as timestamp, id from fruit.order_delivery_orders where calendar_id is not null

請使用以下語法。 希望這對您有幫助。

 CREATE TABLE [ IF NOT EXISTS ] table_name AS SELECT column_names FROM table_name_2 WHERE condition;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM