0
我有兩個單獨的查詢,下面哪些運行正確。現在,我創建了一個計算列以提供YM工作日的計數,並希望將這通過query1(加入將是query1.Period = query2.Yms) 請參閱下面的查詢和輸出。通過在另一個查詢中新創建的計算列
SELECT Client, ClientGroup, Type, Value, Period, PeriodName, PeriodNumber, ClientName
FROM metrics.dbo.vw_KPI_001_Invoice
select YMs,sum(case when IsWorkDay = 'X' then 1 else 0 end) from IESAONLINE.Dbo.DS_Dates
where Year > '2013'
group by YMs
Query 1
Client ClientGroup Type Value Period PeriodName PeriodNumber ClientName
0LG0 KarroFoods Stock 5691.68 201506 Week 06 2015 35 Karro Foods Scunthorpe
Query 2
YMs (No column name)
201401 23