comp.lang.ada
 help / color / mirror / Atom feed
From: "Thomas Løcke" <thomas@12boo.net>
Subject: Re: GNATCOLL.SQL.SQL_Select - I'm in Left_Join hell
Date: Mon, 23 Apr 2012 09:33:26 +0200
Date: 2012-04-23T09:33:26+02:00	[thread overview]
Message-ID: <4f9505c6$0$285$14726298@news.sunsite.dk> (raw)
In-Reply-To: <82vckti989.fsf@stephe-leake.org>

On 04/21/2012 02:02 PM, Stephen Leake wrote:
> You could do each Left join in separate statements before the
> SQL_Select, and pass the final table to SQL_Select.
>
> or use named association to reorder the lines:
>
>    Left_Join
>        (Full =>  Organization,
>         On   =>  Organization.Org_Id = Contactentity_Organization.Org_Id,
>         Partial =>  Left_Join
>           (Full =>  Contactentity_Organization,
>            On   =>  Contactentity.Ce_Id = Contactentity_Organization.Ce_Id,
>            Partial =>  Left_Join
>              (Full =>  Contactentity,
>               On   =>  Contactentity.Ce_Id = Contactentity_Tag.Ce_Id,
>               Partial =>  Left_Join
>                 (Contactentity_Tag,
>                  Tag,
>                  Tag.Tag_Id = Contactentity_Tag.Tag_Id)))),
>
> I don't like the 'full' and 'partial' names, but this looks a little better.
>



I ended up with this:

https://gist.github.com/2469364

Which is good enough. I can read it, and I can reuse the JOIN's in other
queries.

So all in all it ended pretty well.  :o)


-- 
Thomas Løcke | thomas@12boo.net | http://12boo.net



      reply	other threads:[~2012-04-23  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 14:37 GNATCOLL.SQL.SQL_Select - I'm in Left_Join hell Thomas Løcke
2012-04-21 12:02 ` Stephen Leake
2012-04-23  7:33   ` Thomas Løcke [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox