建立/删除/修改临时表
Posted sikuaiwu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了建立/删除/修改临时表相关的知识,希望对你有一定的参考价值。
DROP TEMPORARY TABLE IF EXISTS `SAM_ORDERSIGN_EXCEL_TEMP`;
CREATE TEMPORARY TABLE `SAM_ORDERSIGN_EXCEL_TEMP` (
`CHANNEL` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘渠道‘,
`CHANNEL_NAME` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘渠道名称‘,
`SKU_CHANNEL` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘要货渠道‘,
`PURCHASE_NO` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘采购单号‘,
`WAREHOUSELEVEL2` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘二级仓库‘,
`CHANNEL_SKU` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘商品编号‘,
`CHAI_MATERIA_NO` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘拆分后料号‘,
`IS_PACKAGE` varchar(10) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘套餐否‘,
`PURCHASEORDER_QUANTITY` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘采购数量‘,
`PURCHASE_PRICE` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘采购价格‘,
`ACTUAL_QUANTITY` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘实收数量‘,
`REQUISITION_NO` varchar(30) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘调拨申请单号‘,
`ORDER_NO` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘财务订单号‘,
`GOODS_MODEL` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘型号‘,
`PRODUCTION_MATERIA` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘料号‘,
`RESERVATION_ARRIVEDATE` date DEFAULT NULL COMMENT ‘预约到货日期‘,
`CHANNEL_RECEIVE_DATE` date DEFAULT NULL COMMENT ‘渠道入库时间‘,
`RESERVATION_RECEIPTNO` varchar(80) COLLATE utf8_bin DEFAULT ‘‘ COMMENT ‘预约入库单号‘,
`ITEM` INT(10) AUTO_INCREMENT COMMENT ‘EXCEL项次‘,
PRIMARY KEY (`CHANNEL`,`PURCHASE_NO`,`WAREHOUSELEVEL2`,`CHANNEL_SKU`,`REQUISITION_NO`,`ITEM`),
UNIQUE INDEX `idx_uniq_item` (`ITEM`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT=‘电商订单签收导入临时表‘;
ALTER TABLE SAM_ORDERSIGN_EXCEL_TEMP AUTO_INCREMENT=2;//从2开始自增
set @@auto_increment_offset = 1;//设置自增为1
以上是关于建立/删除/修改临时表的主要内容,如果未能解决你的问题,请参考以下文章