-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
CREATE TABLE spm833262 (
    id INTEGER NOT NULL IDENTITY,
    nickname VARCHAR(20),
    type VARCHAR(10),
    PRIMARY KEY(id)
)
GO

INSERT INTO spm833262 (nickname, type) VALUES('sykofanten', 'kommentar')
GO
INSERT INTO spm833262 (nickname, type) VALUES('buzzzz', 'kommentar')
GO
INSERT INTO spm833262 (nickname, type) VALUES('sykofanten', 'svar')
GO

SELECT *
FROM spm833262
GO

-- positiv
SELECT nickname
FROM spm833262
WHERE type='svar'
GO

-- negativ forkert
SELECT nickname
FROM spm833262
WHERE type<>'svar'
GO

-- negativ rigtig
SELECT nickname
FROM spm833262
WHERE nickname NOT IN (SELECT nickname FROM spm833262 WHERE type='svar')
GO
DROP TABLE spm833262
GO
