SQL 表链接的奇怪问题(子查询速度比整体查询慢!)
代码片段一:
select * from hjt_edb_wlxqjh_detailwhere strWlqdId in ( select strWlqdId from hjt_edb_wlqd_info where strGsWlqdId = ( select B.strWlqdId from hjt_edb_zscjh_info A inner join hjt_edb_wlqd_info B on A.strWlqdId = B.strWlqdId and B.strDelFlg = dbo.DELETE_FLG_0() where A.strDelFlg = dbo.DELETE_FLG_0() and A.strZscJhId = 'strZscJhId_1' ))and strZscJhId = 'strZscJhId_1'
select strWlqdIdfrom hjt_edb_wlqd_infowhere strGsWlqdId = ( select B.strWlqdId from hjt_edb_zscjh_info A inner join hjt_edb_wlqd_info B on A.strWlqdId = B.strWlqdId and B.strDelFlg = dbo.DELETE_FLG_0() where A.strDelFlg = dbo.DELETE_FLG_0() and A.strZscJhId = 'strZscJhId_1')