【发布时间】:2023-04-03 16:10:02
【问题描述】:
我必须更改原始文件并将其拆分,但我不知道如何。
SELECT A.QADAte, A.ProcessorType, A.ASDType ,A.Threshold, A.Accuracy, A.Accept, A.ItemsQty, C.Accuracy Accuracy01, C.Accept Accept01, C.ItemsQty ItemsQty01, D.Accuracy Accuracy07,
D.Accept Accept07, D.ItemsQty ItemsQty07, E.Accuracy Accuracy30, E.Accept Accept30, E.ItemsQty ItemsQty30
from `serv.dbo.accuracies` A inner join
(SELECT ProcessorType, max(QADate) maxQADate FROM `serv.dbo.accuracies` group by ProcessorType)
B ON A.QADate = B.maxQADate and A.ProcessorType = B.ProcessorType and A.SkipNulls = true and A.ASDType = '%' and A.Days=6
left join `serv.dbo.accuracies` C ON C.QADate=DATE_ADD(A.QADate, INTERVAL -1 DAY) and C.ProcessorType = A.ProcessorType and C.ASDType = '%' and C.SkipNulls = true and C.Days=6
left join `serv.dbo.accuracies` D ON D.QADate=DATE_ADD(A.QADate, INTERVAL -7 DAY) and D.ProcessorType = A.ProcessorType and D.ASDType = '%' and D.SkipNulls = true and D.Days=6
left join `serv.dbo.accuracies` E ON E.QADate=DATE_ADD(A.QADate, INTERVAL -30 DAY) and E.ProcessorType = A.ProcessorType and E.ASDType = '%' and E.SkipNulls = true and E.Days=6
结果是这样的
我必须提取 F06 原始数据并将他放入 2 个不同的原始数据,其中 ASDType 不是“%”。我必须保留表格中的其余数据。
拜托,你能帮帮我吗?
【问题讨论】:
标签: sql google-bigquery tableau-api