-- 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) 
SELECT * FROM goodparent JOIN goodchild ON goodparent.id = goodchild.parent_id
GO
SELECT * FROM goodparent LEFT JOIN goodchild ON goodparent.id = goodchild.parent_id
GO

SELECT * FROM badparent JOIN badchild ON badparent.id = badchild.parent_id
GO
SELECT * FROM badparent LEFT JOIN badchild ON badparent.id = badchild.parent_id
GO
