我有两个表,其中包含 ZipCodes,每个表中它们都是相同的。列数据类型相同且大小也相同。有谁知道为什么我的观点没有正确更新?对于第二个表,它总是显示 NULL。谢谢
USE [DB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[myview]
AS
SELECT dbo.Table1.Division, dbo.Table1.RegionName AS Region, dbo.Table1.AccountDir AS RegionManager, dbo.Table2.key,
dbo.Table2.ZipCode, dbo.Table3.ZipCity, dbo.Table3.ZipCounty, dbo.Table3.ZipState
FROM dbo.Table2 LEFT OUTER JOIN
dbo.Table1 ON dbo.Table2.key = dbo.Table1.key LEFT OUTER JOIN
dbo.Table3 ON dbo.Table2.ZipCode = dbo.Table3.ZipCode
邮政编码就像这个 05412。普通的 5 位数拉链。