Skip to content
Advertisement

Using the Like operator with two fields

How do I use the Like operator to join two unidentical tables as below? My main problem is on how to compare the PO filed on tbl2 to the EditNo on tbl1 field. Please see sample tables and expected results below:

tbl1:

tbl2:

Expected:

Query:

SELECT * FROM tbl2 INNER JOIN tbl1 ON tbl2.PONo LIKE EditNo.PO;

Advertisement

Answer

You need wildcards:

The ‘*’ means any character(s).

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement