Questions tagged [inner-join]

The tag has no usage guidance.

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

SOQL `JOIN` by relationship

I have two queries as follows: Is there a way to JOIN them in one query using the Question__r.Id? (I know SOQL doesn't have JOINs, but maybe an alternative solution?) List<Answer__c> l= [...
1
vote
1answer
35 views

How to modify semi-join and anti-joins

I have similar code to this where I want to store the values of a query from a semi-join and anti-join. I want to store the values in a list respective on whether if its a semi-join or anti-join. But ...
2
votes
1answer
45 views

How to structure a multi object query

I have been stuck on this for a couple of days now and have scoured the internet for examples. No luck yet! I have a question about how to structure a query that will return the data that is ...
0
votes
1answer
34 views

Contacts and Orders Join - Primary Key Violation

I'm trying to pull in a list of contacts who've ordered within the last 2 days into a separate DE with the contact ID as the Primary Key. However, I've tried several SQL Join queries in Marketing ...
0
votes
2answers
44 views

How can i combine my variable to with soql command

Hello friends firstly i get field data in contact object and after i start the loop till OwnerId and after i want to combine with my soql command i took error message Error Message: Unexpected token '...
-1
votes
2answers
59 views

I want to write inner join in SOQL i was search but i couldnt found and my thought its a big problem

I try this code its was send this message i couldnt found well answer Note: I want to make innerJoin Account to Contact like this, And i am sure already each other have a releationship Select ...
0
votes
1answer
106 views

SQL Join Within Same Data Extension, Surveys

I made a survey in the Sales Cloud that I am pulling into the Marketing Cloud using automation studio and the responses are saved in a data extension. However every question response appears as a ...
1
vote
2answers
234 views

How do I use this column in a SOQL join?

I'm trying to write a JOIN in SOQL. But having some problems. I have a column PLWorkshopProduct__c in my table that links to another table, Product2. I tried writing the below .. Select ID FROM ...
0
votes
1answer
16 views

Report to show duplicate cases created in 48 hours

I want to create a reports to show only duplicate cases (With same type and sub type) which is created within 48 hrs
2
votes
1answer
605 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 ...
0
votes
1answer
2k views

SOQL Query Inner Join

Could you please help me with the syntaxis of this SOQL Query? I would like to do an INNER JOIN between A and B on A.FamilyMember=B.ID SELECT A.FamilyMember__c FROM A WHERE A.StartDate__c > TODAY ...
1
vote
4answers
796 views

How does class Map work?

I trying to learn Triggers from TrailHead, but not able to understand this line of code. Map<Id,Account> acctsWithOpps = new Map<Id,Account>( [SELECT Id,(SELECT Id FROM Opportunities) ...
0
votes
3answers
530 views

How do i join ContentDocumentLink with Account with SOQL query?

I want to find a file(ContentDocument) which is associated with a particular account with SOQL. I have tried below query. Select LinkedEntityId,ContentDocumentId from ContentDocumentLink where ...
0
votes
1answer
31 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 ...
0
votes
2answers
60 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 ...
2
votes
1answer
2k 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 ...
6
votes
1answer
556 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 ...
3
votes
2answers
619 views

Entity 'Task' is not supported for semi join inner selects

I want add a default task to an opportunity when this one is close won and the opportunity hasn't any task. I get the error compiling the below code: Entity 'Task' is not supported for semi join ...
0
votes
1answer
124 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 ...
0
votes
1answer
102 views

SalesForce How to Join Works?

My SQL Query for Join SELECT LoginIp.SourceIp, LoginHistory.SourceIp FROM ( LoginHistory INNER JOIN LoginIp ON LoginHistory.SourceIp = LoginIp.SourceIp) To get Source Ip from LoginIp table and ...
1
vote
2answers
236 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 ...
0
votes
1answer
33 views

Update date with date field in another table

I'm wanting to update the date field in one table with the date from another table. Below is an example snippet of what I'm trying to achieve. ln.[DateEntered] AS 'acc.[...
-1
votes
2answers
160 views

Why is my join query returning Malformed query?

I have two tables -- RecordType and CventSession__c. THe CventSession__c has a RecordTypeId field taht links back to the RecordType table. How do I write a query to get the CventSession__c.ID and ...
1
vote
1answer
4k views

How to join User, GroupMember and Group in SOQL?

How can I return User.Email and Group.Name from SOQL? I want the group names and the email addresses of their members from a query like: SELECT User.Id, User.Email, Group.Name from User WHERE Id IN ...
1
vote
1answer
183 views

What is the maximum number of rows retrieved in a SOQL NOT IN clause?

What is the maximum number of rows, which can be queried inside a NOT IN clause? For example, let's say I have this query: SELECT Id FROM Campaign WHERE Id NOT IN ( SELECT xxx__campaign__c FROM ...
0
votes
1answer
985 views

Is there a way to go from Task -> Case?

I have a SOQL query that is returning records that should not be returned. As a little backstory - To solve this, I added on a IN clause to the end of my query but I am getting "Entity 'Task' is not ...
1
vote
1answer
707 views

I have a Parent->Child->GrandChild .. I need one object constructed and returned for a rest call

I need to construct one object that will return Forms->Section->Question The objects are Master-Child relationships in the above order. Please let me know how I can construct this object. Appreciate ...
1
vote
2answers
1k views

SOQL - Left Join Help

I am not getting the right results back from my join query. I want all Employee_Benefit_Summary__c records that have a Grand_Total_Premium__c value greater than 0 that do not have any related ...
3
votes
3answers
20k views

Converting SQL to SOQL

I am transitioning to learning SOQL and am struggling with some basic concepts (specifically, joining tables and using multiple tables in the where clause). Can you help me figure out how the below ...
0
votes
1answer
145 views

LEFT ANTI JOIN SOQL on a non-indexed field [closed]

While doing a left anti join in soql on a non-indexed field. The query is failing with QUERY_TIMEOUT. 'QUERY_TIMEOUT: Your query request was running for too long.' Here is my query- SELECT ID,...
2
votes
1answer
4k views

SOQL joining multiple tables to get account info from record owner

So I have a custom object standard controller and I want to auto-populate a field on a form from the users account record. In preparation to build my controller I need a valid SOQL statement and I'...
0
votes
1answer
555 views

BATCH Class - Inner Queries - Questions/Doubts [closed]

I am doing few thing in Batch - and I was curious whether : My SOQL Queries will work with 50000+ records ? Will my SOQL's take too much time to execute and cause Time Out, etc ? SOQL SELECT id, ...
0
votes
1answer
654 views

SOQL join two tables - all contacts from lead

I have a Lead object and would like to get all contacts for this Lead. I was not able to find an appropriate method in apex and decided to make a query. Unfortunately I don't have much experience with ...
13
votes
1answer
5k views

Single SOQL query for Accounts without Contacts

How to query those Account which has not any related Contacts ? I have Queried Account and contact in inner query. I found All Account with that Account I looped and find those Account whose Contact ...
1
vote
1answer
587 views

SOQL Inner query pageblocktable

I have Application object and References as Child object. I want to display list of Applications and corresponding "number of References records" for each application in VF Page. There is a status ...