C# 如何解决连接问题显示相同的结果

C# 如何解决连接问题显示相同的结果,c#,sql,C#,Sql,我有两个表,客户和列表类型数据。我只想把这两张桌子连接起来。 我在Customers表中有CityId和DistrictId 它给了我城市和地区相同的修复方法 对于城市和地区 SELECT c.[CustomerId] ,c.[Name] ,c.[CompanyName] ,c.[ShopNo] ,list.[Description] AS 'City' ,list.[Description] AS 'Distr

我有两个表,
客户
列表类型数据
。我只想把这两张桌子连接起来。 我在
Customers
表中有
CityId
DistrictId

它给了我
城市
地区
相同的修复方法 对于
城市
地区

  SELECT c.[CustomerId]
        ,c.[Name]
        ,c.[CompanyName]
        ,c.[ShopNo]
        ,list.[Description] AS 'City'
        ,list.[Description] AS 'District' 
  FROM [MakkiRuskFaisalabad].[dbo].[Customers] c
  JOIN [dbo].[ListTypesData] list ON c.CityId = list.ListTypeDataId ]

您需要再次
加入
列表类型数据
表:

SELECT c.CustomerId
  ,c.Name
  ,c.CompanyName
  ,c.ShopNo
  ,list.Description AS 'City'
  ,list2.Description AS 'District' 
FROM MakkiRuskFaisalabad.dbo.Customers c
    JOIN dbo.ListTypesData list ON c.CityId = list.ListTypeDataId
    JOIN dbo.ListTypesData list2 ON c.DistrictId = list2.ListTypeDataId

您需要再次
加入
列表类型数据
表:

SELECT c.CustomerId
  ,c.Name
  ,c.CompanyName
  ,c.ShopNo
  ,list.Description AS 'City'
  ,list2.Description AS 'District' 
FROM MakkiRuskFaisalabad.dbo.Customers c
    JOIN dbo.ListTypesData list ON c.CityId = list.ListTypeDataId
    JOIN dbo.ListTypesData list2 ON c.DistrictId = list2.ListTypeDataId