3
該查詢返回兩次相同的數據行。我的內連接有什麼問題嗎?或者哪裏有條款?SQL查詢返回兩次相同的數據行
SELECT
transaction_details.transaction_number,
transaction_details.transaction_id,
transaction_details.product_id,
Products3.ProductName
FROM
transaction_details
INNER JOIN
Products3 ON transaction_details.product_id = Products3.productID
INNER JOIN
transaction_status ON transaction_details.transaction_id = transaction_status.transaction_id
WHERE
transaction_details.transaction_id = 'tr-y9404'
AND status_of_transaction = 'pending'
這裏是輸出
我懷疑你有多個'transaction_details'記錄每個'transaction'?更改爲'select * from ...'並查看哪一列正在更改,這將指向具有多條記錄的表。 – DavidG