db_select query for given sql query with equi join
You can built any type of select query using db_select, you can see in detail on following url
https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_select/7.x