title: custom object lookup relationship soql query to get sobject
body: <p>I have 2 custom object.</p>
  
  <pre><code>1 - namespace__object1__c
  2 - namespace__object2__c
  </code></pre>
  
  <p>I have lookup relationship in custom object namespace__object2__c.</p>
  
  <p>Now i want to query id record from object2 where object1 id = (provided parameter) </p>
  
  <pre><code>String s = 'a6T3k0000LMJcEAO';
  string query = 'select ID, (select ID from namespace__object1__c where ID = :s  ) from namespace__object2__c';
  
  SObject rObject = database.query(query);
  system.debug(rObject);
  </code></pre>