Pattern search using SQL


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in D:\InetPub\vhosts\kwu-1639.package\kennywu.info\wwwroot\wp-content\plugins\wp-syntax\wp-syntax.php on line 380

Instead of exact matching, the following code allows you to do a pattern search by joining two table using like operator.

SELECT *
FROM Table1
INNER JOIN Table2 ON Table1.col LIKE '%' + Table2.col + '%'

Leave a Reply

Your email address will not be published. Required fields are marked *