Skip to content

Instantly share code, notes, and snippets.

@ThomasLocke
Created April 19, 2012 14:18
Show Gist options
  • Save ThomasLocke/2421241 to your computer and use it in GitHub Desktop.
Save ThomasLocke/2421241 to your computer and use it in GitHub Desktop.
SQL_Select hell...
Query := SQL_Select
(Fields =>
Organization.Org_Id &
Organization.Org_Name &
Organization.Sip_Uri &
Contactentity.Ce_Id &
Contactentity.Ce_Name &
Contactentity.Isperson &
Tag.Tag_Id &
Tag.Tag_Name,
From =>
Left_Join
(Organization,
Left_Join
(Contactentity_Organization,
Left_Join
(Contactentity,
Left_Join
(Contactentity_Tag,
Tag,
Tag.Tag_Id = Contactentity_Tag.Tag_Id),
Contactentity.Ce_Id = Contactentity_Tag.Ce_Id),
Contactentity.Ce_Id = Contactentity_Organization.Ce_Id),
Organization.Org_Id = Contactentity_Organization.Org_Id),
Where => Organization.Org_Id = 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment