SQL left join query using Drupal DB Layer
I've seen this before, I can't remember why it's this way but you can fix it by swapping out which types of quote you use.

Changing your code to this will fix the problem:

$query = db_select( 'node', 'n' )
  -&gt;fields( 'n', array('created', 'title', 'type'));

// Change wrapping quotes to "" and internal to '' for 3rd arg here
$query-&gt;leftJoin( 'url_alias', 'ua', "ua.source = CONCAT('node/', n.nid)");

$query-&gt;addField('ua', 'alias');
$results = $query-&gt;execute();


It's either a Drupal or PDO issue, as either type of quote works fine when executing directly against the MySQL server.