<?php
SELECT DISTINCT tbl.id
FROM tbl
WHERE tbl.id NOT IN (
SELECT test.id
FROM test);
?>
<?php
SELECT DISTINCT tbl.id
FROM tbl
WHERE tbl.id NOT IN (
SELECT test.id
FROM test);
?>