码迷,mamicode.com
首页 > 数据库 > 详细

mysql 创建临时表

时间:2018-06-22 13:35:06      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:null   临时   name   ble   avg   into   style   har   rar   

 

 创建临时表

create TEMPORARY table SalesSummary(
product_name VARCHAR(50) NOT NULL,
total_sales DECIMAL(12,2) NOT NULL DEFAULT 0.00,
avg_unit_price DECIMAL(7.2) NOT NULL DEFAULT 0.00,
total_units_sold INT UNSIGNED NOT NULL DEFAULT 0
);

 

插入数据

INSERT INTO SalesSummary
    (product_name, total_sales, avg_unit_price, total_units_sold)
    VALUES
    (cucumber, 100.25, 90, 2);

SELECT * from SalesSummary

 删除临时表

DROP TABLE SalesSummary;

 

mysql 创建临时表

标签:null   临时   name   ble   avg   into   style   har   rar   

原文地址:https://www.cnblogs.com/gylhaut/p/9212561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!