I want a dynamic query to do inner join on same table.
My query is:
SELECT t1.table1 FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id AND t1.name = t2.name"
I want to join table1 and table2 based on id and name present in table2.
What is the equivalent dynamic query in Drupal for this? How this can be achieved?