这是我的 SQL 语句...
SELECT
dbo.PPMASTER.Per_or_Bus,
dbo.PPMASTER.Assessment_Date,
dbo.PPBUSMST.Assessment_Number,
dbo.PPBUSMST.Year
FROM dbo.PPBUSMST INNER JOIN dbo.PPMASTER
ON dbo.PPBUSMST.Assessment_Number = dbo.PPMASTER.Assessment_Number
WHERE (dbo.PPBUSMST.Assessment_Number = @Assessment)
问题是我得到了来自Assessment_Date
. 每个人每年Assessment_Date
应该只有一个结果。有任何想法吗?
这是一些结果示例数据...
**B 1996-05-29 00:00:00 9005450 1996**
B 1996-05-29 00:00:00 9005450 1997
B 1996-05-29 00:00:00 9005450 1998
B 1996-05-29 00:00:00 9005450 1999
B 1996-05-29 00:00:00 9005450 2000
B 1996-05-29 00:00:00 9005450 2001
B 1996-05-29 00:00:00 9005450 2002
B 1997-05-29 00:00:00 9005450 1996
**B 1997-05-29 00:00:00 9005450 1997**
B 1997-05-29 00:00:00 9005450 1998
B 1997-05-29 00:00:00 9005450 1999
B 1997-05-29 00:00:00 9005450 2000
B 1997-05-29 00:00:00 9005450 2001
B 1997-05-29 00:00:00 9005450 2002
B 1998-04-27 00:00:00 9005450 1996
B 1998-04-27 00:00:00 9005450 1997
**B 1998-04-27 00:00:00 9005450 1998**
B 1998-04-27 00:00:00 9005450 1999
B 1998-04-27 00:00:00 9005450 2000
B 1998-04-27 00:00:00 9005450 2001
B 1998-04-27 00:00:00 9005450 2002
我已经**的那些是我真正想要达到的结果