れ 2螳 貎朱Μ 觜 豸′ 覲碁.
--1
select
a.CodeNM1
, a.CodeNM2
, a.CodeNM3
, a.CodeNM4
, a.CodeNM5
, sum(b.Cnt*1.0)
from #temp a inner join dbo.Fact_Test b
on a.CodeKey1 = b.CodeKey1
and a.CodeKey2 = b.CodeKey2
and a.CodeKey3 = b.CodeKey3
and a.CodeKey4 = b.CodeKey4
and a.CodeKey5 = b.CodeKey5
group by
a.CodeNM1
, a.CodeNM2
, a.CodeNM3
, a.CodeNM4
, a.CodeNM5
order by 1,2,3,4,5
--2
select
b.CodeNM1
, c.CodeNM2
, d.CodeNM3
, e.CodeNM4
, f.CodeNM5
, sum(a.Cnt*1.0)
from dbo.Fact_Test a
inner join dbo.Dim_TestCode1 b
on a.CodeKey1 = b.CodeKey1
inner join dbo.Dim_TestCode2 c
on a.CodeKey2 = c.CodeKey2
inner join dbo.Dim_TestCode3 d
on a.CodeKey3 = d.CodeKey3
inner join dbo.Dim_TestCode4 e
on a.CodeKey4 = e.CodeKey4
inner join dbo.Dim_TestCode5 f
on a.CodeKey5 = f.CodeKey5
group by
b.CodeNM1
, c.CodeNM2
, d.CodeNM3
, e.CodeNM4
, f.CodeNM5
order by 1,2,3,4,5
れ ろ螻 覲伎企 螳 貎朱Μ 觜谿願 覦. 豌 豌襴螳 襷 谿企. 豌 覯讌 貎朱Μ 蟆曙 5豐 豌襴螳 覈朱 覯讌 貎朱Μ 20豐螳 . ろ碁 2005覯 蟆伎襷 蠍磯蓋 螳 ろ語企襦 朱 Star Join 螳企手 螳覃 . SQL Server Star Join れ 瑚.