-- Collection of code snippets by Arne Vajhøj 
-- posted to eksperten.dk, usenet and other places (2002-now) 
CREATE DATABASE kompletdb;
USE kompletdb;
CREATE TABLE tbl(navn VARCHAR(50) PRIMARY KEY);
INSERT INTO tbl VALUES ('A');
INSERT INTO tbl VALUES ('B');
INSERT INTO tbl VALUES ('C');
CREATE DATABASE inkompletdb;
USE inkompletdb;
CREATE TABLE tbl(navn VARCHAR(50) PRIMARY KEY);
INSERT INTO tbl VALUES ('A');
INSERT INTO tbl VALUES ('B');
USE TEST;
SELECT * FROM kompletdb.tbl;
SELECT * FROM inkompletdb.tbl;
SELECT * FROM kompletdb.tbl WHERE navn NOT IN (SELECT navn FROM inkompletdb.tbl);
DROP DATABASE kompletdb;
DROP DATABASE inkompletdb;
