+ Start a Discussion

query join with criteria matching 2 different custom objects

Hi I have 2 different custom objects with field values same in both objects and wanted to query matching records. Also wanted to query records from both objects.
in sql I write like this
(SELECT Ord.OrderID__c, Cust.CustomerName__c, Ord.OrderDate__c
FROM Orders__c  Ord
INNER JOIN Customers__c  cust
ON Ord.CustomerID__c=Cust.CustomerID__c)

Please let me know how can I write in soql.

thanks in advance.