-- 两个表的字段 都需要查出来
select j.*, h.* from jilu j
left join huiyuan h on j.id = h.comid
where j.huiyuantoken = ''
;
-- 只需要查询jilu表的字段
select j.* from jilu j
where
exists(select 1 from huiyuan h on j.id = h.comid where j.huiyuantoken = ''
)
;
select h.id,h.huiyuanming,huiyuantoken,shoujihao,comid,neirong from huiyuan h join jilu j on h.huiyuanming=j.huiyuanming where h.huiyuantoken='tkk' and j.comid=5;