On 16 Dec 2002, at 23:50, Stefan Hinz, iConnect (Berlin wrote: > > I need to construct a query to find out what customers in the database > > have not > > booked shipments with us. That means there would be no > > records in the shipment table for a given customer id. > > If I get this right, it should be: > > SELECT custid, name FROM customers LEFT JOIN shipment ON custid = customerid > WHERE shipmentid IS NOT NULL
Darren wants the customers who do *not* have shipments, so it should be "... WHERE shipmentid IS NULL". -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org Phone 202-667-6653 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php