Results 1 to 7 of 7

Thread: Select... In

  1. #1

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    hmm... nadda with that. it returned everything when I know there should only be about 100 or so records returned.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Sorry. I've never tried to do something like this.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Okay, can you explain to me what data you are trying to pull? I have a feeling you are looking for data that is in the details table but their id is not in the customer table.

    Is that correct?
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  4. #4

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    yeah, the details has the information about a customers order (qty, item_num, etc) and links to the customer table with customer_ID. the customer table has all their shipping info. Now the guy before me messed up with his logic and would just delete orders by clearing them out of the customer table and not touching the details table. Make sense? So I'm doing some clean up and I want to clean out all those orders that are in the details table but not in the customer table. Kinda get where I'm at? I could do it in a PHP script but I know there's gotta be a way to do this in just SQL. At least to print out all the orders that are in details table and not customer table. It's kinda of a personal mission now... it could be done another way but I want to make this work.

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    So...is this solved yet or no?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    no. Im still thinking about how to do it using only mysql syntax
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  7. #7
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Have you tried just:

    SELECT * from details,customer WHERE details.customer_ID != (SELECT ID from customer);

    We had a thread about that not too long ago.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width