日期:2014-05-16  浏览次数:21039 次

如何去掉这里的重复数据呢?急急~~~~~
SELECT   Charge_Temp.CopyDate,   Charge_Temp.UserID,   Charge_Temp.Name,   [Users]![Area]   &   [Users]![Road]   &   [Users]![Address]   AS   Addr,   [ChargeMeters]![CurNum]-[ChargeMeters]![PreNum]   AS   SumDegree,   ChargeMeters.Money,   Charge_Temp.OtherFee,   Charge_Temp.SumFee,   Charge_Q.IfPay,   Charge_Q.IfPrint,   Charge_Q.IfNote,   Charge_Q.PayDate,   Charge_Q.Operator
FROM   (ChargeMeters   INNER   JOIN   Meters   ON   ChargeMeters.MeterID   =   Meters.MeterID)   INNER   JOIN   ((Charge_Temp   INNER   JOIN   Charge_Q   ON   (Charge_Temp.CopyDate   =   Charge_Q.CopyDate)   AND   (Charge_Temp.UserID   =   Charge_Q.UserID))   INNER   JOIN   Users   ON   Charge_Temp.UserID   =   Users.UserID)   ON   (ChargeMeters.CopyDate   =   Charge_Temp.CopyDate)   AND   (Meters.UserID   =   Charge_Temp.UserID);

上面的查询语句显示的数据如下,我使用的是查询视图,这里出现了好几个是重复的,应该如何去掉呢?去掉的结果在也在下面。请高手们赐教!!!
CopyDate UserID Name Addr SumDegree Money OtherFee SumFee
IfPay IfPrint IfNote PayDate Operator
2007-4 U_001 001 鼓楼区同安路01 125.69 126 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 44.94 45 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 32.69 33 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 125.69 126 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 44.94 45 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 32.69 33 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 125.69 126 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 44.94 45 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 32.69 33 0 204 No No No
2007-4 U_002 002 台江区禾祥西路02 119.76 120 0 389 No No No
2007-4 U_002 002 台江区禾祥西路02 268.6 269 0 389 No No No
2007-4 U_002 002 台江区禾祥西路02 119.76 120 0 389 No No No
2007-4 U_002 002 台江区禾祥西路02 268.6 269 0 389 No No No
2007-4 U_003 003 台江区禾祥东路03 126.67 127 0 127 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 108.97 109 0 232 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 122.57 123 0 232 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 108.97 109 0 232 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 122.57 123 0 232 No No No


去掉重复的结果如下:
CopyDate UserID Name Addr SumDegree Money OtherFee SumFee IfPay IfPrint IfNote PayDate Operator
2007-4 U_001 001 鼓楼区同安路01 125.69 126 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 44.94 45 0 204 No No No
2007-4 U_001 001 鼓楼区同安路01 32.69 33 0 204 No No No
2007-4 U_002 002 台江区禾祥西路02 119.76 120 0 389 No No No
2007-4 U_002 002 台江区禾祥西路02 268.6 269 0 389 No No No
2007-4 U_003 003 台江区禾祥东路03 126.67 127 0 127 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 108.97 109 0 232 No No No
2007-4 U_004 004 鼓楼区禾祥东路fasdfasd 122.57 123 0 232 No No No

------解决方案--------------------
select distinct……