Received: from eba-haus.de ([149.228.241.103]) by hub.org (8.10.1/8.10.1) with SMTP id e65AVrS79800 for ; Wed, 5 Jul 2000 06:31:53 -0400 (EDT) Received: from kopo001 by eba-haus.de;Wed, 05 Jul 2000 10:31:30 GMT with Novell_GroupWise; Wed, 05 Jul 2000 12:31:30 +0200 Message-Id: X-Mailer: Novell GroupWise 5.5.2 Date: Wed, 05 Jul 2000 12:31:16 +0200 From: "Gerhard Dieringer" To: Cc: Subject: Antw: Problem with joins Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e65AVsS79801 X-Archive-Number: 200007/28 Jean-Marc Libs wrote: >... >I have also tried: >select source_name,data_value from source,data where data_source_id=source_id union select source_name,source_id,NULL from source,data >This is a bit better, in the sense that I get back all I need, but there >are too many lines: when there is data, I get the line with the data value >and also with NULL. >... You are on the right way. Change your querry to select source_name,data_value from source,data where data_source_id=source_id union select source_name,source_id from source WHERE source_id NOT IN (SELECT source_id FROM data); and you will get your expected result. BTW this simulates an outer join. Gerhard