我下面这个(set。。。)是错的,但是我想实现这个怎么写代码呢?insertinto`level-2metric`(`Year`,`Quarter`,`Month`,`SupplyChain`,`Region`,`%ofOrdersDeliveredInFull(Supplier)...
我下面这个(set 。。。)是错的,但是我想实现这个怎么写代码呢?
insert into `level-2 metric`(`Year`,`Quarter`,`Month`,`Supply Chain`,`Region`,`% of Orders Delivered In Full (Supplier)`, `Delivery Performance to Commit Date (Supplier)`,`Documentation Accuracy (Supplier)`,`Perfect Condition (Supplier)`)
select `Year`,`Quarter`,`Month`,
(set `Supply Chain`="Global" and “Region”=“Global" ), /*就是这里想手动赋值 )
(sum(`Delivered in Full(?)`)/count(`Mat Ref`)) as `%InFull`,
(sum(`Delivery Performance to Commit Date by Supplier(?)`)/count(`Mat Ref`)) as `%CommitDate`,
(sum(`Documentation Accuracy(?)`)/count(`Mat Ref`)) as `%Documentation`,
(sum(`Perfect Condition(?)`)/count(`Mat Ref`)) as `%PerfectCondition`
from `supplier order input metric`
group by `Year`,`Quarter`,`Month`
展开