我有这样的查询:
select
F_ExhibitionCode,
F_ExhibitorCode
from
T_ExhibitorLocation
where
F_ExhibitorCode in (
select
F_Exhibitor_Code
from
T_Exhibitor
where
F_Exhibitor_Name LIKE '%''%')
我还有两个表,一个是*
T_Exhibition *
,另一个是“T_Exhibitor,F_exhibiton
名称来自T_Exhibition
而F_ExhibitorCode
来自T_Exhibitor
,
最终结果我需要这样:
F_Exhibitonnaem,F_Exhibition代码,F_exibitorname,F参展商代码。
答案 0 :(得分:3)
假设我理解你的表结构,我会建议这些内容:
SELECT EL.F_ExhibitionCode, EL.F_ExhibitorCode, E.F_exhibiton_name
FROM T_ExhibitorLocation EL
INNER JOIN T_Exhibitor E ON(EL.F_ExhibitorCode = E.F_ExhibitorCode)
WHERE E.F_Exhibitor_Name LIKE '%''%'