-
help with a query
I have two tables, each with three fields. Each table has a vendor field, but there not going to be identical. I need to search through the vendors if I can find a partial match. I've tried...
SELECT table1.vendor, table2.vendor
FROM table1, table2
WHERE table1.vendor = '%table2.vendor%'
I put in a dummy field that I knew would match just to make sure, but it still didn't return anything...any advice?
thanks,
eye
-
use LIKE instead of the =
-
SELECT table1.vendor, table2.vendor
FROM table1, table2
WHERE table1.vendor = '%table2.vendor%'
Try using Like instead of =
WHERE table1.vendor Like '%table2.vendor%'
-
I've tried that too. Doesn't return anything and I have a dummy record in there that should get returned
eye
:confused:
-
try this then
SELECT table1.vendor, table2.vendor
FROM table1, table2
WHERE table1.vendor like '%'+table2.vendor+'%'
-
hey doe, tried that query...it just keeps running....