Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Based on my original understanding of the question, I suggested to just add the keyword NOT</p> <pre><code>SELECT * FROM tableA WHERE item NOT IN (... items ...) </code></pre> <p>But as per the comment the above will not return what you want. The original question was edited to include this new infomration.</p> <p>So, you need to get your data from your WHERE clause into a form that is queryable. Here is one way to do it where I create an additional table named "items" and have INSERT statements to place each item into this items table. Since I do not have access to your data, I am going to use integers for the items and set it up with a smaller amount of data.</p> <pre><code>--Set up some sample data CREATE TABLE tableA(item INT PRIMARY KEY) INSERT INTO tableA SELECT 1 INSERT INTO tableA SELECT 2 INSERT INTO tableA SELECT 3 INSERT INTO tableA SELECT 4 INSERT INTO tableA SELECT 9 INSERT INTO tableA SELECT 10 SELECT * FROM tableA WHERE item IN (0,1,2,3,4,5,6) SELECT * FROM tableA WHERE item NOT IN (0,1,2,3,4,5,6) -- Create a table and insert all the 860 items from your where clause CREATE TABLE items(item INT) INSERT INTO items SELECT 0 INSERT INTO items SELECT 1 INSERT INTO items SELECT 2 INSERT INTO items SELECT 3 INSERT INTO items SELECT 4 INSERT INTO items SELECT 5 INSERT INTO items SELECT 6 -- Want to find a query that returns all of the items in the newly created items table -- that are not in the original tableA (in this example, the values returned are 0,5,6) SELECT * FROM items WHERE item NOT IN (SELECT item FROM tableA) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload