Jose Maria Arrobio Jose Maria Arrobio - 5 days ago 6
SQL Question

Trying to figure out what's wrong with this SQL statement

SELECT P_descript, p_price, v_name
From Vendor, Product
WHERE p_price > 6.99 AND Vendor.V_STATE IN ('TN')
Inner Join Vendor ON product.v_code = vendor.v_code
ORDER BY p_price DESC;


The inner join on this keeps getting underlined in Oracle SQL Developer. I'm not exactly sure what's wrong with it but I feel like it's correct. Please help me out.

Answer

You have Vendor twice in the statement, first in the from statement and then on the inner join.

Try this :

SELECT P_descript, p_price, v_name 
From Product
Inner Join Vendor ON Product.v_code = Vendor.v_code
WHERE p_price > 6.99 AND Vendor.V_STATE IN ('TN')
ORDER BY p_price DESC;
Comments