Questions tagged [outer-join]

Outer join is type of join in which co-existing subset + other records are returned

Filter by
Sorted by
Tagged with
0 votes
1 answer
150 views

Querying parent's related list from the child object

I just wonder if this is possible and cannot find anything online about it, so imagine the following scenario: Let's say we have a parent object named Parent__c and it has 2 related lists of objects: ...
SkyAnthrax94's user avatar
0 votes
1 answer
603 views

SOQL 4 level Relationship

I am new to SOQL and working with a 4 Level parent - child Relationship: Level1 (Parent) Level2 (Child) Level3 (Grand Child) Level4 (Great Grand child) I am trying to pull records from Level1, Level2 &...
Amudha's user avatar
  • 1
2 votes
1 answer
2k views

SOQL join in a Parent Child for same table (Account)

I want to write this simple soql query where in Account there is a ParentId and with it would want to bring the name of this parent (Hierarchy field) Something like: select Id, Name, (select Name ...
Christian Paquin's user avatar
0 votes
1 answer
643 views

Is it possible to query the chattergoup where the current user is in in one query

I am trying to get the group where the current user is in. In this case the user can only be member of one group. I tried the following but the I would have to loop trough the CollaborationGroup ...
Thomas's user avatar
  • 2,294
0 votes
2 answers
245 views

Combining SOQL Queries

I need to pull out a query that fetches: From My Team object and Package object. Package is a child of Teams From teams I need to pull how many packages is currently in teams and how much each ...
adming32442's user avatar
2 votes
1 answer
9k views

How to access child records from an inner query in apex [duplicate]

I have a piece of code in my Apex: List<sObject> assessmentToQuestions = [ SELECT Id, (SELECT Id FROM zced__Assessment_Questions__r) questions FROM zced__Assessment__c ...
iloveseven's user avatar
  • 1,105
6 votes
1 answer
922 views

Complicated SOQL SELECT

I have the following data model: Now I would like to do the following: By knowing zced__Interaction__c extract all the zced__Assessment__c. Then for each of the extracted zced__Assessment__c I would ...
iloveseven's user avatar
  • 1,105
0 votes
1 answer
310 views

How to find duplicate records for master record

I have 3 (A,B,C) objects they are A-master B-Junction object and C master of B object, B object has the Master detail relationship with A and B objects. When the records created for B due to some ...
Vivek P's user avatar
  • 197
1 vote
2 answers
772 views

SOQL: Left join Contact fields to custom object

So i have a custom object which has in of one of the fields( Creator__c ) the Id of the person who created it which is also the Contact Id, and i'm trying to get the contacts first and last name field ...
lordZ3d's user avatar
  • 163
0 votes
1 answer
4k views

SOQL Joins compared to SQL Joins [closed]

What are the key differences between SOQL Joins and SQL Joins?
benahm's user avatar
  • 2,567
0 votes
1 answer
354 views

Join salesforce objects with AMPscript within the same email

I want to create a transactional email for orders, containing data about the consumer (Account object), data about his order (Order object) and data about the ordered products (products object). The ...
Sarah Bezi's user avatar
3 votes
2 answers
1k views

SOQL performance of joins

Considering the following scenario: Objects: Child__c, Parent1__c, Parent2__c Relationships: Child__c - Parent1__c (Lookup) Child__c - Parent2__c (Master-detail) I want to query for Parent1 and ...
elian's user avatar
  • 33
0 votes
2 answers
363 views

SOQL join or relation query

I have 2 tables Deal__c and DealProduct__c. They have one to many relation. I want to combine 2 SOQL queries with different where clause: Select Name, Date_Of_Deal__c, Total_Amount__c from Deal__c ...
user569925's user avatar
  • 1,167
5 votes
2 answers
1k views

Convert SQL query into SOQL query

I've been trying to figure out how to turn this SQL query into a SOQL query. Every time I think I am getting better with SOQL something comes along and erases that thought. Account is the parent ...
twiggler's user avatar
  • 103
2 votes
1 answer
628 views

Best approach for creating Junction object with millions of records

I have two objects Object1 and Object2 in Salesforce. These two objects doesn't have Master-Detail relationship. But they are related through a Text column X. I want to create many to many junction ...
karthikselva's user avatar
  • 2,446
6 votes
2 answers
3k views

SOQL Outer Join Multi Level Master Detail Relationship

I am working with a 3 Level Master Detail Object Relationship: "Level 1" has "Level 2" detail records "Level 2" has "Level 3" detail records I am trying to Query "Level 1 records" and using an ...
Justin J Carlson's user avatar