abipc
abipc

Reputation: 1035

MySQL create temporary table

Cannot understand why this create temporary table is not working.. Can anyone suggest..?

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);

It gets an error "query interrupted".

This query works fine -

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

Upvotes: 0

Views: 303

Answers (1)

Pankaj K
Pankaj K

Reputation: 758

Please used below syntax. May this help you.

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

Upvotes: 1

Related Questions