Showing data that is not already in the data base I have the following problem. I want to search a query in an existing data base and that the result shows me the entries of the query that are NOT already in the database. 

Minimal example:

| ID | name | 
| 1 | Paul | 
| 2 | Clara | 


ID Query (1,3)

The result should be 3! 

So I want to do something like this:

Select * from names Where ID Not in (1,3);


But well this is obviously not correct.

Furthermore, I don't want to insert an additional table with the query!
Does anyone know a solution for this problem?
SELECT args_list.id
FROM ( SELECT 1 id 
       UNION ALL
       SELECT 3 ) args_list /* the ID's you need to check for presence */
LEFT JOIN names ON args_list.id = names.id
WHERE names.id IS NULL


In MySQL 8+ you can transfer the id's list into the query as CSV string and parse it to separate values in CTE. It will be something like (not tested)

WITH src AS ( SELECT '1,3' src ),
     RECURSIVE 
     num AS ( SELECT 1 num
              UNION ALL
              SELECT num + 1
              FROM num
              WHERE num &lt; (SELECT MAX(LENGTH(src) - LENGTH(REPLACE(src, ',', ''))
                           FROM src) ),
     ids AS ( SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(src, ',', num), ',', -1)
              FROM src, num )
SELECT ids.id
FROM ids
LEFT JOIN names ON ids.id = names.id
WHERE names.id IS NULL