SELECT
lpn.TC_LPN_ID
FROM LPN lpn
WHERE lpn.inbound_Outbound_Indicator = 'O'
AND lpn.tc_company_id = 1403
AND lpn.TC_REFERENCE_LPN_ID **IN**
(SELECT
l.tc_lpn_id
FROM lpn l
WHERE l.TC_COMPANY_ID = 1403
AND l.inbound_Outbound_Indicator = 'I'
AND (l.tc_lpn_id= '000990950' OR l.TC_REFERENCE_LPN_ID = '000990950'))
想将我的查询修改为EXISTS。
EXISTS提高性能。