How to use wildcard in a JOIN ON using a string

Found others looking for the same, how to use wildcard in a JOIN ON using a string reference:

This is how I soleved it with wildcard:

SELECT acl.* , node.type FROM acl
LEFT JOIN node ON ( acl.name LIKE concat( '%', node.nid ) )
WHERE 1

This is how I soleved it with fixed value:

SELECT acl.* , node.type FROM acl
LEFT JOIN node ON ( acl.name LIKE concat( 'view_', node.nid ) )
WHERE 1

This is how I soleved it with pattern like [something]_[nid]:

SELECT acl . * , node.type, node.title FROM acl
LEFT JOIN node ON ( acl.name LIKE concat( '%', '\_', node.nid ) )
WHERE 1

Ref: http://forums.mysql.com/read.php?108,414000,414000#msg-414000

Knowledge keywords: