Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default Can you compare a list against a table, and see which items aren't in table?

    I have a large list of items and I'd like to see if they exist in database table, but I don't want to run one query after another. Is there a way I can take a list of items and run it quickly against a table and find out which items don't exist in both?

  2. #2
    yellowledbet is offline Senior Member
    Join Date
    Feb 2011
    Location
    Georgia, USA
    Posts
    122
    Rep Power
    0

    Default Re: Can you compare a list against a table, and see which items aren't in table?

    I think an IN clause containing your list values used in a SQL query can accomplish what you are asking

  3. #3
    Join Date
    May 2010
    Posts
    7
    Rep Power
    0

    Default Re: Can you compare a list against a table, and see which items aren't in table?

    Quote Originally Posted by yellowledbet View Post
    I think an IN clause containing your list values used in a SQL query can accomplish what you are asking
    Thanks I thought that as well but I don't know how big a SQL statement can be, or how many INs you can have, or how slow an IN is. That's why I wasn't sure if it was the best way to go. In any case, like is often the case for me, after I wrote out my question I figured out a solution that might work for me. Thanks for the reply though! :)

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

    Default Re: Can you compare a list against a table, and see which items aren't in table?

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 1
    Last Post: 09-27-2011, 07:06 AM
  2. Replies: 1
    Last Post: 01-08-2010, 07:19 AM
  3. Creating a SWT table with 1,000,000 items
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:31 PM
  4. How to print selected items in a SWT table
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:30 PM
  5. How to remove selected items in a SWT table
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-11-2008, 05:29 PM

Posting Permissions

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