How to concatenate a string in a WHERE clause of an SQL query? I'm trying to execute the following query but when I append the 'n.nid = "node/" + ua.source' condition I'm getting an error page:

        $query = db_select('node', 'n')-&gt;extend('PagerDefault');
        $query-&gt;join('url_alias', 'ua', 'n.nid = "node/" + ua.source');
        $nids = $query
            -&gt;fields('n', array('nid', 'sticky', 'created'))
            -&gt;condition('type', 'news')
            -&gt;condition('status', 1)
            -&gt;orderBy('sticky', 'DESC')
            -&gt;orderBy('created', 'DESC')
            -&gt;limit(3)
            -&gt;addTag('node_access')
            -&gt;execute()
            -&gt;fetchCol();


Any suggestions to resolve this?
There is a small changes in code. I think it will help you.

$query = db_select('node', 'n')-&gt;extend('PagerDefault');
        $query-&gt;join('url_alias', 'ua', "ua.source = CONCAT('node/', n.nid)" );
        $nids = $query
            -&gt;fields('n', array('nid', 'sticky', 'created'))
            -&gt;condition('type', 'news')
            -&gt;condition('status', 1)
            -&gt;orderBy('sticky', 'DESC')
            -&gt;orderBy('created', 'DESC')
            -&gt;limit(3)
            -&gt;addTag('node_access')
            -&gt;execute()
            -&gt;fetchCol();


For more info check