Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpcc05!hpcc01!hansene From: hansene@hpcc01.HP.COM (Ed Hansen) Newsgroups: comp.databases Subject: Re: How do I get SQL (Unify 4.0) to pull all linked Message-ID: <770006@hpcc01.HP.COM> Date: 13 May 91 16:46:42 GMT References: <1991May7.000450.1699@hrc.uucp> Organization: HP Corp Computing & Services Lines: 29 / hpcc01:comp.databases / dan@hrc.uucp (Dan Troxel) / 5:04 pm May 6, 1991 / How do I get all records from table_1, even though some records in table_1 are not linked to table_2??? select table_1.field_1, table_2.field_2 from table_1, table_2 where table_1.field_1 = table_2.field_1 /******************************************************************/ What you need here is an 'Outer Join' and I don't think this is available in Unify. In SYBASE , your query will be as follows : select table_1.field_1, table_2.field_2 from table_1, table_2 where table_1.field_1 *= table_2.field_1 Another way of achieving this result is by using UNION (again not supported by Unify ? ) as follows : select table_1.field_1, table_2.field_2 from table_1, table_2 where table_1.field_1 = table_2.field_1 union select table_1.field_1, NULL from table_1 where table_1.field_1 not in (select table_2.field_1 from table_2) JeanMarie (jeanmar@hpcc31.corp.hp.com) /*****************************************************************/