Write a SELECT statement that returns the same result set as this SELECT statement. Substitute a subquery in a WHERE clause for
the inner join.SELECT DISTINCT VendorNameFROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorIDORDER BY VendorNameInsert one screen capture here that shows a single query with result that meets all of the above requirements.
WHERE VendorName= ANY (SELECT VendorName FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID) ORDER BY VendorName;
Explanation:
All bold faced words are sql keywords for different purposes. The subquery return the all values which matches the join condition and main query will choose only distinct values and make them in order of VendorName.
There many other queries also return the same result as returned by given query.
A system used for processing customer payments. A tool used to coordinate recruitment of new employees. A mobile app used by customers to place orders.