Thanks Jean and Tracy! Your help gets me going and I am filing your solutions for future study - Joe
On Monday, February 09, 2009 9:52 AM, Jean MAURICE wrote: > >Date: Mon, 09 Feb 2009 15:52:17 +0100 >From: Jean MAURICE >To: [email protected] >cc: >Subject: Re: SQL help > >If you are working with VFP9 try a 'left outer join' like in this template > > SELECT A.Id, B1.Type as Typ1, NVL(B2.Type, " ") as Typ2; > FROM A INNER JOIN B b1 ON a.id = b1.parent AND b1.type ="a" ; > LEFT OUTER JOIN B b2 ON a.id = b2.parent AND b2.type = "b" > >here above you will have a line if there is a line in B for typ1 even if >there is no line for typ2. I have written the condition on b1.type and >b2.type in the JOIN clause instead of the WHERE clause. It is not the >same thing. If conditions are in the WHERE claus, VFP will first try to >build a set of record with the join and then filter it with the WHERE. > >I hope I am clear ! > > >-- >Jean MAURICE >Grenoble - France - Europe >www.atoutfox.org >www.aedtf.org > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

