表1:PartMaster
PartNo
======
Part1.DRW
Part2.DRW
Part3.ASM
Part3.PRT
Part1.XLT
Part2.ASM
Part3.ASM
Part3.DRW
Part4.ASM
Part4.DRW
Part5000.PRT
表2:PartINPUT
PART
=====
Part1
Part2
Part3
.
.
.
PART5000
我正在尝试从PartMaster表中找到一个项目
select *
from PartMaster PM
where PM.PartNo in (select PI.PART from PARTINPUT PI
where PM.PartNo like '%PI.PART%')
我尝试过:
select *
from PartMaster PM
where PM.PartNo in (select PI.PART from PARTINPUT PI where PM.PartNo like '%PI.PART%)'
和
select *
from PartMaster PM
where PM.PartNo in (select PI.PART from PARTINPUT PI where PM.PartNo like '%' || PI.PART ||'%')'
结果应基于第二个输入表中匹配的%part%返回表PartMaster中的所有项目。
答案 0 :(得分:1)