This question already has answers here:
SQL column reference "id" is ambiguous (5 answers)
Closed 5 days ago.
For my homework, I have to enter example queries from the book to sql. There are also example database I downloaded for the homework and properly put them into SQL. The following is what I have to put in but an error message comes up.
SELECT V_CODE, V_NAME, V_STATE, P_CODE, P_DESCRIPT, P_PRICE * P_QOH AS TOTAL
FROM PRODUCT P JOIN VENDOR V ON P.V_CODE = V.V_CODE
WHERE V_STATE IN ('TN','KY')
ORDER BY V_STATE, TOTAL DESC;
--Total value of products from Tennessee and Kentucky
Ambiguous column name 'V_CODE'
Not sure how to fix.
I had to put in an example query from the homework but an error message comes up.
"Ambiguous column name 'V_CODE'"
1条答案
按热度按时间rsaldnfx1#
您需要选择要从中选择
V_CODE
的表。在本例中,它取自PRODUCT
表。