function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
YashYash 

Wants to reterive data from two custom object in single SOQL

Hi,

I want to reterive the data from two custom objects in a single query.

I tried following snippet.

[select Category_Name__c,Item_Number__c,Item_Description__c,Upc__c,Sellable__c from Item_Master__c I,Category_Master__c C where I.Category_Id__c = C.Category_Id__c ];

But it is giving following error:

ErrorError: Compile Error: unexpected token: C.Category_Id__c at line 90 column 163


Can anybody have solution for this?


Thanks
Yash
Sam.arjSam.arj
Hi Yash,
Your SOQL is not formatted correctly.

Try using Force Explorer, it helps building the SOQL statements.

The two custom object can only be in one statement if they have a "RELATIONSHIP" (master-detail or lookup).