RSS Forums RSS

Display customer data which is not in other table

Please support our MySQL advertiser: Programming Forums
Reply
Posts: 16
Reputation: BillyMako is an unknown quantity at this point 
Solved Threads: 0
BillyMako BillyMako is offline Offline
Newbie Poster

Display customer data which is not in other table

  #1  
Dec 2nd, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,143
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 121
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: Display customer data which is not in other table

  #2  
Dec 2nd, 2008
That should be simple :-

  1. SELECT *
  2. FROM customers
  3. WHERE customers_id NOT IN (
  4. SELECT customers_id
  5. FROM orders
  6. )
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 399 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:44 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC