Question: this query get customers ordered bikes and helmets but I want to change it to get customers ordered bikes but not the helmet SELECT CUSTBIKES.
SELECT CUSTBIKES. CustFirstName, CUSTBIKES.CustLastName FROM (SELECT DISTINCT CUSTOMER.CustomerID, CUSTOMER.CustFirstName, CUSTOMER.CustLastName FROM ((CUSTOMER INNER JOIN [ORDER] ON CUSTOMER.CustomerID = [ORDER). CustomerID) INNER JOIN ORDER DETAIL ON (ORDER). OrderID = ORDER_DETAIL.OrderID) INNER JOIN PRODUCT ON PRODUCT.ProductID = ORDER DETAIL.Product ID WHERE PRODUCT.ProductName LIKE **Bike') AS CUSTBIKES INNER JOIN (SELECT DISTINCT CUSTOMER.CustomerID FROM ((CUSTOMER INNER JOIN [ORDER] ON CUSTOMER.CustomerID = [ORDER] .CustomerID) INNER JOIN ORDER_DETAIL ON [ORDER] . OrderID = ORDER_DETAIL.OrderID) INNER JOIN PRODUCT ON PRODUCT.ProductID -ORDER DETAIL. ProductID WHERE PRODUCT . Product Name LIKE "*Helmet') AS CUSTHELMETS ON CustBikes.CustomerID USTHELMETS. CustomerID ORDER BY CustBikes.CustLastName
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
