I have 2 tables, one with Vendors and one with Products. There is a foreign key shared between the 2 tables which is a Code. I need a command that displays which vendors have codes matching the products table. There fore the data displayed will tell us Which Vendors provide products and which vendors do not. I only need to display the ones that do provide products.
SELECT * FROM vendor where V_CODE = V_CODE FROM product;
I have a pseudo code logic here which is what I am looking for. I want SQL to display All vendors who have a matching V_CODE in both the vendor and products table.
SELECT * FROM vendor where V_CODE = V_CODE FROM product;
This code does not compile because FROM is not in a valid position