我的数据源 DimAddress 和 DimGeoInforamtion 中有两个维度。如果我想使用地址表中的层次结构,我将从 DimAddress 表中获取地址、城市和邮政编码,但我将从 DimGeoInformation 表中获取状态。我如何在它们之间创建层次结构>?
CREATE TABLE DimAddress
(
[AddressID] [int]IDENTITY(1,1) NOT NULL,
[Address] [varchar](MAX) NULL,
[ZipCode] [Varchar(5)] NULL,
[AddressSpatialID] [int] NULL,
[City] [varchar](50) NULL,
[CitySpatialID] [int] NULL,
[CityID] [int] NOT NULL
)
CREATE TABLE DimGeoInformation
(
[CountyID] [int] IDENTITY (1,1) NOT NULL,
[County] [varchar](50) NULL,
[CountySpatialID] [bigint] NULL,
[StateID] [tinyint] NOT NULL,
[State] [varchar](25) NOT NULL,
[RegionID] int
[RegionName] varchar(50)
)