0
我有兩個表包含有這些數據內部聯接無重複的值SQL
表1(10行) Table1
MaintRateSplit_ID MaintChargeItem_ID
86 256
87 256
88 256
89 256
90 256
91 256
92 256
93 256
94 256
95 256
表2(10行) Table2
MaintChargeItem_ID Contribution_Maximum_Value
256 175642.00
256 33851.00
256 130888.00
256 54612.00
256 66903.00
256 246747.00
256 503602.00
256 85944.00
256 262130.00
256 152892.00
當我嘗試連接這兩個表時,我得到了100行。有沒有解決方案只獲得10行?
SELECT MaintRateSplit_ID,Contribution_Maximum_Value
FROM Table1
INNER JOIN Table2
ON Table1.MaintChargeItem_ID = Table2.MaintChargeItem_ID
This is the desired result
MaintRateSplit_ID Contribution_Maximum_Value
86 175642.00
87 33851.00
88 130888.00
89 54612.00
90 66903.00
91 246747.00
92 503602.00
93 85944.00
94 262130.00
95 152892.00
請發表您的樣本數據,文本,圖像可能被阻擋在某些領域 – TheGameiswar
並添加您的查詢,很難說有什麼錯你的SQL,如果它不包括問題:) – MeanGreen
您的條件對於每個記錄對都是如此,因此您的結果中會得到10 x 10 = 100行。你還期望什麼?你希望得到的結果是什麼? –