• interesting (and worrying!)

    SELECT * FROM customer WHERE customer.customerid in (SELECT customer.customerid FROM salesorder)

    If you just run the subquery, then you get an error.

    The answer you get (two records) is wrong by any standard as customer ID 2 does not exist in the subquery table

    Interestingly, if you drop the table name from the subquery

    SELECT * FROM customer WHERE customer.customerid in (SELECT customerid FROM salesorder)

    you get the right answer

    Any idea why the first query does not throw an error?