I have two tables
taxonomy_index
-nid
-tid
and
url_alias
-source
-alias
I need to find url_alias.alias record which have source 'taxonomy/term/' + taxonomy_index.tid and I have only taxonomy_index.nid
Either use a subquery or a join. With a subquery:
SELECT alias
FROM url_alias
WHERE source =
(SELECT CONCAT('taxonomy/term/',tid)
FROM taxonomy_index
WHERE nid = ?
)