For Drupal 7, Field abc and field def both belong to same content type
$query = db_select('field_data_field_abc','ex')
->fields('ex', array('field_abc_value'));
$query->join('field_data_field_def', 'fsr', 'fsr.entity_id = ex.entity_id');
$query->addField('fsr', 'field_ort_target_id');
$query->join('node', 'n', 'ex.entity_id = n.nid');
$query->addField('n','changed');
$query->addField('n', 'uid');
$result = $query->execute()->fetchAll() ;
In the above query how can I get the user uid and user name using relation between node uid and user uid. Bcoz. when I joined the users table , my results are empty
(string) $query
before execution to see the SQL that's being produced, that should help you identify what needs to be fixed