SELECT DISTINCT ON ("COMMCLASS_ID", "commInterpretation".commname) * FROM "commClass" LEFT JOIN "commInterpretation" USING ("COMMCLASS_ID") ORDER BY "COMMCLASS_ID", "commInterpretation".commname, "COMMINTERPRETATION_ID"