我有 2 个表要连接,没有匹配的 id,如下所示;
表_a
id name
1 moe
2 joe
3 bob
4 sue
表_b
id accessid
10 moe99
11 joe53
12 bob51
13 312sue
我尝试使用 INSTR() 连接/加入这两个表。以下是我的代码;
select *
from table_a
join table_b
on INSTR(table_a.name , table_b.accessid ) > 0
但是,我得到了这个
错误:函数 instr(字符变化,字符变化)不存在提示:没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。
我也尝试使用:
select *
from table_a
join table_b
on table_a.name like '%' + table_b.accessid + '%'
和
select *
from table_a, table_b
where table_a.name like '%' + table_b.accessid + '%'
但是这两个结果是;
查询没有返回匹配的行
任何人都可以帮助我吗?