79476983

Date: 2025-03-01 01:09:15
Score: 1.5
Natty:
Report link
  1. Put your list into temporary table.
  2. then Left join with your foo table and count which not exist.

-- This is your Foo table:

CREATE TEMPORARY TABLE IF NOT EXISTS foo (UNIQUE idx_foo (id), id int);

INSERT INTO foo (id) VALUES (1),(2),(3),(4),(5);

-- This is your Check List

CREATE TEMPORARY TABLE IF NOT EXISTS tmp_ids (UNIQUE idx_tmp (id), id int);

INSERT INTO tmp_ids (id) VALUES (1),(2),(6);

-- This is Result: 1

SELECT COUNT(t.id) FROM tmp_ids t LEFT JOIN foo f ON t.id=f.id WHERE f.id is null;

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: HakanYavuz