why my solution is wrong?please look at.

  • 0

    select Customers.Name as Customers from Customers left join Orders on Customers.Id <> Orders.CustomerId ;

  • 0

    By definition:
    LEFT JOIN is to return all the rows in table 1 and match the rows in the table 2 when there are matches. So your code is not working.

    Whatever after ON, should has "equal" sign included, not something like "<>". You will need add extra lines if you want to use LEFT JOIN

    # Write your MySQL query statement below
    SELECT c1.Name as Customers
    FROM (
                SELECT c.Name, o.Id
                FROM Customers c
                LEFT JOIN Orders o
                ON c.Id = o.CustomerId
         ) c1
    WHERE c1.Id is NULL;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.