DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   Display customer data which is not in other table (http://www.daniweb.com/forums/thread160378.html)

BillyMako Dec 2nd, 2008 2:46 am
Display customer data which is not in other table
 
What i want to do is display all the customers data which is in the 'customers' table where their 'customers_id' is NOT IN the 'customers_id' field in the 'orders' table.

I hope i made sense!

Thanks,
Billy

stephen84s Dec 2nd, 2008 5:30 am
Re: Display customer data which is not in other table
 
That should be simple :-

SELECT * 
FROM customers
WHERE customers_id NOT IN (
  SELECT customers_id
  FROM orders
)


All times are GMT -4. The time now is 1:09 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC